一、python的基本数据类型:
python的基本数据类型包括:数字、布尔值、字符串、列表、元组、字典、集合
- 如何查看数据类型:
通过type将想要查看其数据类型的数据用括号括起来即可查看
temp = "python"
t = type(temp)
print(t)
输出结果:
- 查看数字类型的方法
方法 |
作用 |
type |
查看数据类型 |
help,type |
查看类下全部方法 |
dir |
查看类下全部方法名 |
ctrl+鼠标左键 |
查看类特定方法 |
(1)使用help,type查看类下全部方法:
t = type(temp)
print(t)
help(type(temp))
输出结果: