Tuples in python: 19 MCQs

All 19 multiple-choice questions from this kit, free and with no sign-up.

Warm-up · 10 questions

Q1. Which of the following is a correct way to create an empty tuple in Python?

Beginner
A empty = {}
B empty = []
C empty = ()
D empty = None

Answers and explanations are in the Veda app.

Q2. What is the output of `len((1, 2, 3))`?

Beginner
A 2
B 3
C 4
D 1

Answers and explanations are in the Veda app.

Q3. Which of the following correctly accesses the second element of tuple `t = (10, 20, 30)`?

Beginner
A t[1]
B t[0]
C t[-1]
D t[2]

Answers and explanations are in the Veda app.

Q4. What is the output of `(1, 2, 3) == (1, 2, 3)`?

Beginner
A Error
B False
C None
D True

Answers and explanations are in the Veda app.

Q5. What is the output of `t = (1, 2, 3); print(t[-1])`?

Beginner
A 1
B 2
C Error
D 3

Answers and explanations are in the Veda app.

Q6. Which built-in function converts a list to a tuple?

Beginner
A dict()
B list()
C set()
D tuple()

Answers and explanations are in the Veda app.

Q7. Tuples are mutable in Python.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q8. A tuple can contain elements of different data types.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q9. The `in` operator can be used to check if an element exists in a tuple.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q10. Tuples support item assignment like lists.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Building up · 9 questions

Q11. Which of the following statements about tuples is TRUE?

Intermediate
A Tuples can be modified after creation.
B Tuples are immutable.
C Tuples are unordered collections.
D Tuples cannot contain duplicate elements.

Answers and explanations are in the Veda app.

Q12. What is the result of `(1, 2) + (3, 4)`?

Intermediate
A Error
B (1, 2, 3, 4)
C (1, 2, 3, 4, 5)
D (4, 6)

Answers and explanations are in the Veda app.

Q13. What does `(1, 2, 3) * 2` return?

Intermediate
A (1, 2, 3, 1, 2, 3)
B Error
C (2, 4, 6)
D (1, 2, 3, 2)

Answers and explanations are in the Veda app.

Q14. Which method can be used to find the index of a value in a tuple?

Intermediate
A locate()
B find()
C index()
D search()

Answers and explanations are in the Veda app.

Q15. Which of the following is NOT a valid tuple operation?

Intermediate
A t.count(2)
B t.append(4)
C t.index(2)
D len(t)

Answers and explanations are in the Veda app.

Q16. What is the type of `x` after `x = 1, 2, 3`?

Intermediate
A int
B tuple
C list
D set

Answers and explanations are in the Veda app.

Q17. What does `t = (1, 2, 3); a, b, c = t; print(a)` output?

Intermediate
A 2
B 3
C (1, 2, 3)
D 1

Answers and explanations are in the Veda app.

Q18. Which of the following creates a single-element tuple?

Intermediate
A t = (1,)
B t = (1)
C t = [1]
D t = 1

Answers and explanations are in the Veda app.

Q19. What is the result of `(1, 2, 3).count(2)`?

Intermediate
A 3
B 0
C 1
D 2

Answers and explanations are in the Veda app.

Make your own

Your notes can be a kit like these

Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free to start, in more than 40 languages.

  • Chapter notes
  • Flashcards
  • Practice MCQs
  • Scored tests
  • Paper Solver

Get Veda free See what students get

Free to start · Android app and web · More than 40 languages