元組tuple型態
a = (20, 30, 50, 34)
print(type(a))
b = tuple("askidkjxjekek")
print(b)<class 'tuple'>
('a', 's', 'k', 'i', 'd', 'k', 'j', 'x', 'j', 'e', 'k', 'e', 'k')a = (20, 30, 50, 34)
print(a[2])
a[2] = 10050
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-6-aef5d1a8539e> in <module>
1 a = (20, 30, 50, 34)
2 print(a[2])
----> 3 a[2] = 100
TypeError: 'tuple' object does not support item assignmentLast updated