数字类型

#int整数
i1 = 1
i2 = int(2)
i =int()
print(i1,type(i1))
print(i2,type(i2))
print(i,type(i))

#float小数
f1 = 1.1
f2 = float(2.2)
f = float()
print(f1,type(f1))
print(f2,type(f2))
print(f,type(f))

#complex复数

#bool布尔,True、False、None
b1 = True
b2 = False
b = bool()#空为假
print(b1,type(b1))
print(b2,type(b2))
print(b,type(b))

#str字符串
s = ''
s1 = str()
print(s,type(s))
print(s1,type(s1))

posted @ 2023-06-08 21:53  ApolloStudio  阅读(8)  评论(0)    收藏  举报