对象类型 | 例子 |
---|---|
数字 | 1234,3.1415,3+4就,Decimal,Fraction |
字符串 | ‘spam’,"good",b'a\xolc' |
列表 list | [1,[2,'three'],4] |
字典 dict | {'name':'zhang','age':40} |
元组 tuple | (1,'good',4,'X') |
文件 file | myfile=open('file','r') |
集合 set | set('abc'),{'a','b','c'} |
对象类型 | 例子 |
---|---|
数字 | 1234,3.1415,3+4就,Decimal,Fraction |
字符串 | ‘spam’,"good",b'a\xolc' |
列表 list | [1,[2,'three'],4] |
字典 dict | {'name':'zhang','age':40} |
元组 tuple | (1,'good',4,'X') |
文件 file | myfile=open('file','r') |
集合 set | set('abc'),{'a','b','c'} |