python0

1,输出:print(" hello,world!")
2,简单数学运算:
加:3+3,
减:3-2,
乘:2*2(2的10次方 2**10),
除:8/2=4.0,
取余:8%3=2
3,Variables:
>>> x = 3
>>> x + 4
>>> 7
4,Modules and Functions
>>> abs(-1)
>>> 1
>>> pow(2,3)
>>> 8
>>> import math
>>> math.sqrt(9)
>>> 3
>>> bucky = math.sqrt
>>> bucky(81)
>>> 9
5,how to save your program
in python shell (IDLE): File - New Window,make ur program and then save it as xx.py,a python file,then, Run - Run Module,the python file will be executed.

你可能感兴趣的:(python0)