- 变量类型
1.字符串str 2.数字 int float complexs.. 3.列表list 4.元组 tuple 5.字典 dict
数值类型
number = 10
number = number + 10 # 增值操作符 number += 10 number -= 10 number /= 10
import math
# 乘方、开方,2>比1>快,书写简单,更易理解
1> math.pow(3, 10)
Out[]: 59049.0
2> 3 ** 10
Out[]: 59049
# 度的转换,180度指的是π
In [ ]:math.radians(180)
Out[]: 3.141592653589793
# 取最小值,最大值
min(10, 20, 30, 1)
max(10, 20, 30, 1)
# 第一个为商,第二个为余数
In [ ]:divmod(10, 3)
Out[ ]: (3, 1)