L6 Tuple Container
L6 Tuple Container
and Practise a p
gan
th u
M u
a n
th
L5 - Tuple container m a n a
R a
Demo using
at h
a p
gan
th u
u
L6_tuple_ex_access.py
n M
th a
n a
m a
R a
a n
ath
a n
HW:In a tuple, find the number of objects of each type.
R a m
Demo using
at h
a p
gan
th u
u
L6_tuple_operations.py
n M
th a
n a
m a
R a
• Tuple is an iterable.
h y
at
• Tuple is like a structure in C. an
a p
u g
uth
• No tuple comprehension (why?) th a n M
n a
ma
• You can use list a
comprehension
R and then use ‘tuple’ function
• Tuple of Tuples
h y
at
• Tuple embedding an
a p
u g
uth
• Tuple unpacking (using * operator)than M
n a
m a
R a
print(*ite)
a n
ath
a n
HW: WAP to print the transpose of a 3X5 matrix.
R a m
R
print(lst)