int型
a = 1
print(type(a))
输出结果为:
<class 'int'>
float型
a = 1.1
print(type(a))
输出结果为
<class 'float'>
str型
a = 'hello'
print(type(a))
输出结果为
<class 'str'>
列表
a = [1, 2, 3]
print(type(a))
输出结果为:
<class 'list'>
元祖
a = (1, 2, 3)
print(type(a))
输出结果
<class 'tuple'>
集合
a = {1, 2, 3}
print(type(a))
输出结果
<class 'set'>
字典
a = {'dog': 'white', 'height': '70'}
print(type(a))
输出结果
<class 'dict'>