python中的List是同构的还是异构的?
最佳答案
>>> def a(): pass
>>> lst=[1,'one',{1:'one'},a,[1,1],(1,),True,set((1,))]
>>> for each in lst:
... print type(each), str(each)
...
<type 'int'> 1
<type 'str'> one
<type 'dict'> {1: 'one'}
<type 'function'> <function a at 0x100496938>
<type 'list'> [1, 1]
<type 'tuple'> (1,)
<type 'bool'> True
<type 'set'> set([1])
有什么问题吗?
关于python - Python 中的列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5150958/