示例示例Python中的基本数据类型包括:整型(int):
Python中的基本数据类型包括:
1. 整型(int):
代表整数,如:
a = 10
print(type(a))
输出:
2. 浮点型(float):
代表小数,如:
b = 10.5
print(type(b))
输出:
3. 字符串(str):
代表字符串,如:
c = "Hello World!"
print(type(c))
输出:
4. 布尔型(bool):
代表布尔值,如:
d = True
print(type(d))
输出:
5. 复数(complex):
代表复数,如:
e = 3 + 4j
print(type(e))
输出:
本站系公益性非盈利分享网址,本文来自用户投稿,不代表边看边学立场,如若转载,请注明出处
评论列表(42条)