Quiz on Python Tuple Exercises



1. What is the output of the following code: tuple1 = (1, 2, 3); print(tuple1[1])?
2. Which method can be used to find the count of a specific element in a tuple?
3. How do you concatenate two tuples in Python?
4. What will be the output of the following code: tuple1 = (5, 10, 15); tuple2 = (1, 2, 3); print(tuple1 + tuple2)?
5. Is it possible to change the elements of a tuple?

Advertisements