基本数据类型:整数、浮点数、字符串、布尔值
>>> type(3)
<class 'int'>
>>> type("3")
<class 'str'>
>>> type(True)
<class 'bool'>
>>> type(8.8)
<class 'float'>
类型转换
>>> type(int('8'))
<class 'int'>
>>> type(str(8))
<class 'str'>
>>> bool(0)
False
>>> bool(123)
True
网友评论