||
http://docs.python.org/2/tutorial/datastructures.html#SECTION007300000000000000000
tuple是由逗号分开的
>>> t=12345,54321,'hello!'
>>> t[0]12345
>>> t(12345, 54321, 'hello!')
>>> # Tuples may be nested:
... u=t,(1,2,3,4,5)
>>> u
((12345, 54321, 'hello!'), (1, 2, 3, 4, 5))
tupe中元素值不能更改,可以用做dictionary key。
>>> x,y,z=t
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-10-15 20:19
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社