Operation
Interpretation
( )
An empty tuple
t1 = (0,)
A one-item tuple (not an expression)
t2 = (0, 'Ni', 1.2, 3)
A four-item tuple
t2 = 0, 'Ni', 1.2, 3
Another four-item tuple (same as prior line)
t3 = ('abc', ('def', 'ghi'))
Nested tuples
t1[i]t3[i][j]t1[i:j]len(t1)
Index, slice, length
t1 + t2t2 * 3
Concatenate, repeat
for x in t23 in t2
Iteration, members
Powered by: BlogJava Copyright © Jafe Lee