Basic
Tuples Operations
Tuples
respond to the + and * operators much like strings; they mean concatenation and
repetition here too, except that the result is a new tuple, not a string.
In
fact, tuples respond to all of the general sequence operations we used on
strings in the prior chapter −
Python Expression
|
Results
|
Description
|
len
|
3
|
Length
|
Concatenation
|
||
Repetition
|
||
3
in
|
True
|
Membership
|
for
x in
|
1
2 3
|
Iteration
|