Professional Documents
Culture Documents
2
• For example, a person’s name, age and birth date
Tuples
3
Tuples vs list
Tuples List
Tuples are used for heterogeneous List are used for homogeneous data types
datatypes
5
Operations on tuples
Operator Meaning
+ Concatenation operator
Comparison operator(element
<,>
wise)
Minimum value in
Min()
a tuple
Maximum value in
max()
a tuple
Sum of elements in
sum()
a tuple
Convert a string or
tuple()
a list to tuple
Count ()
returns the number of occurrences of a value in the tuple.
Index()
returns the index of a value in the tuple.
Membership operators
Operators Meaning
For loop
While loop
Working with tuples (python programs)
https://www.programiz.com/python-
programming/tuple
https://en.wikipedia.org/wiki/Tuple