Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

What is a tuple in Python?
A. An unordered collection
B. A mutable ordered collection
C. An immutable ordered collection
D. A key-value pair
Direction: Choose the correct option

Q2.

How do you create a tuple with a single element?
A. (1,)
B. [1]
C. {1}
D. -1
Direction: Choose the correct option

Q3.

What is the output of `type((1,2,3))`?
A. <class 'tuple'>
B. <class 'list'>
C. <class 'set'>
D. <class 'dict'>
Direction: Choose the correct option

Q4.

Can you modify a tuple after creation?
A. No, tuples are immutable
B. Yes, by reassigning
C. Yes, with `append()`
D. Yes, with `remove()`
Direction: Choose the correct option

Q5.

How do you unpack a tuple into variables?
A. All of the above
B. (a,b) = (1,2)
C. a,b = [1,2]
D. a,b = (1,2)
Direction: Choose the correct option

Q6.

What is the output of `(1,2) + (3,4)`?
A. (1,2,3,4)
B. (1,2,3,4)
C. (1,2,3,4)
D. (1,2,3,4)
Direction: Choose the correct option

Q7.

What does `len((1,2,3))` return?
A. 3
B. 1
C. 4
D. 2
Direction: Choose the correct option

Q8.

Which of the following is a valid tuple?
A. 1,2
B. (1,2)
C. All of the above
D. (1,)
Direction: Choose the correct option

Q9.

What is the output of `(1,2) * 3`?
A. (3,6)
B. (1,2,3)
C. (1,2,1,2,1,2)
D. Error
Direction: Choose the correct option

Q10.

Why would you use a tuple instead of a list?
A. All of the above
B. Immutability ensures data integrity
C. Usable as dictionary keys
D. Better performance in some cases