Tuple Quiz

 

Tuple in Python - MCQ Quiz

🟣 Tuple in Python — MCQ Quiz (15)

Select one answer per question. Click Submit to see your score.

1. Which Python data type is immutable?
2. How do you create a single-element tuple containing the string "a"?
3. How do you access the first element of a tuple t?
4. Which built-in function converts a list [1,2,3] into a tuple?
5. Which operator concatenates two tuples (1,2) and (3,4)?
6. Which tuple method returns the number of occurrences of a value?
7. Which of the following operations is not allowed on tuples?
8. What is the type of the result when you slice a tuple like t[1:4]?
9. Which statement deletes the entire tuple variable myt?
10. Given t = (1, (2,3)), what is the value of t[1][0]?
11. Which of these methods is defined for tuples?
12. Which code performs tuple unpacking?
13. How do you convert a tuple t into a list?
14. What does max((2,7,3)) return?
15. Can you change (mutate) the element at index 0 of a tuple t with t[0]=5?

Comments

Popular posts from this blog

Topic1 :- What is Python Programming?

Topic2: -Why Python?

Topic7: What is Numpy?