一、变量类型
1.字符串 str
2.数字 int float complex
3.列表 list
4.元组 tuple
5.字典 dict
二、数值类型
math.pow(x,y)
print(math.pow(3,10))
print(math.floor(2.314),math.ceil(2.314))
print(math.radians(180))#度的转换
print(min(1,2,3,4), max(1,2,3,4), sum([1,2,3,4]), divmod(10,3))
输出:
59049.0
2 3
3.141592653589793
1 4 10 (3, 1)
三、bool型
True False
True == 1 False == 0
print(True+10) # 输出 11
与运算、或运算、非运算
四、字符串类型一
1.字符串赋值
line = "hello"
2.字符串相加
line = line1 + line2
3.字符串相乘
line = "nihao "
print(line*10)
输出:nihao nihao nihao nihao nihao nihao nihao nihao nihao nihao
4.字符串长度
len(line)
5.id()
id函数,返回一个身份标识符,可以理解为一个变量的内存地址