小王老师教编程 Python内置数据类型精讲
1_颗粒类数据
#Author:BlKola
#小王老师教编程 https://www.bilibili.com/video/BV1tK4y1t7rF?spm_id_from=333.999.0.0
#字符串、数字型、逻辑型都是颗粒类数据类型
a = 8
print("数字型:",a)
b = 'beijing'
print("字符串:",b)
c = True
print("逻辑型:",c)
2_数字型数据
#Author:BlKola
#小王老师教编程 https://www.bilibili.com/video/BV1tK4y1t7rF?spm_id_from=333.999.0.0
a = 8
print(type(a),a)
b = 1.2
print(type(b),b)
print('10 - 5 =',10 - 5)
print('1.2 + 1.3 =',1.2 + 1.3)
print('1 + 1 =',1 + 1)
print('1 - 1 =',1 - 1)
print('1 * 8 =',1 * 8
共有 0 条评论