python共有六类基本数据类型,即数字、字符串、数组、字典、元组、集合。
1.数字(Num)
数字分为:整形(int)、浮点(float)、复数(complex,使用函数complex()建立)、布尔(bool)
2.字符串(str):如 ‘ab123’
3.数组(list): 如 [1,2,3]
4.元组(tuple):如(1,2,3)
5.字典(dict):如{a:'b'}
6.集合(set)使用函数set()建立
python共有六类基本数据类型,即数字、字符串、数组、字典、元组、集合。
1.数字(Num)
数字分为:整形(int)、浮点(float)、复数(complex,使用函数complex()建立)、布尔(bool)
2.字符串(str):如 ‘ab123’
3.数组(list): 如 [1,2,3]
4.元组(tuple):如(1,2,3)
5.字典(dict):如{a:'b'}
6.集合(set)使用函数set()建立