4.1 tupleoperators.pdf

(309 KB) Pobierz
Tuple Iteration and Operators
Iteration
: traversing and visiting all the elements of a tuple .
t1=(‘jack’, 45, 38.6, false, 5+6j,’Jill’, 45)#this is a tuple
t1
It looks like this in memory.
Iteration can be done using for loop
Creating a tuple using for loop
This can be done using while loop also
Operators in tuple
Index
Slicing
Concatenation
Repeat
Membership
Membership
Zgłoś jeśli naruszono regulamin