变量的类型
type(被查看类型的数据)
# 方式1: 使用print直接输出类型信息 print(type("黑马程序员")) print(type(666)) print(type(11.345))
<class 'str'>
<class 'int'>
<class 'float'>
string_type = type("黑马程序员") int_type = type(666) float_type = type(11.345) print(string_type) print(int_type) print(float_type)
<class 'str'>
<class 'int'>
<class 'float'>

浙公网安备 33010602011771号