type()函数

type()函数应用

作用:查询数据类型

a = 'asd'
b = '我们'
c = 123
d = 1.23
print(type(a))
print(type(b))
print(type(c))
print(type(d))

>>>
<class 'str'>
<class 'str'>
<class 'int'>
<class 'float'>

在type()函数的帮助下,我们知道也可以查找出数据的类型

posted @ 2019-10-21 11:00  明浩999  阅读(593)  评论(0编辑  收藏  举报