python常用的数据类型
int_num = 7 float_num = 7.7 string = "python" a, b, c = 7, 7.7, "python" print(int_num, type(int_num)) print(float_num, type(float_num)) print(string, type(string)) print(a, b, c) print("a=%.6f"%a) print(len(c))
运行结果:
7 <class 'int'> 7.7 <class 'float'> python <class 'str'> 7 7.7 python a=7.000000