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()函数的帮助下,我们知道也可以查找出数据的类型

原文地址:https://www.cnblogs.com/minghaoAQ/p/11712201.html