4月 7th, 2008at 15:28
Tags: Python
Pytho2.5のタプル
タプルは不変なので変更できない。
print ()print (0, 1, 2)print (0, 1, (2.0, 2,1)) t = (0, 1, 2)print t[1]print len(t)print t + tprint t * 3
実行結果
()(0, 1, 2)(0, 1, (2.0, 2, 1))13(0, 1, 2, 0, 1, 2)(0, 1, 2, 0, 1, 2, 0, 1, 2)




