Tuples in python: 19 MCQs with answers

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
Show answer & explanation

empty = ()

An empty tuple is created using empty parentheses (). [] creates a list, {} creates a dict, and None is a special value.

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

Beginner
A 2 B 3 C 4 D 1
Show answer & explanation

3

The len() function returns the number of elements in the tuple, which is 3.

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]
Show answer & explanation

t[1]

Indexing starts at 0, so the second element is at index 1.

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

Beginner
A Error B False C None D True
Show answer & explanation

True

Tuples are compared element-wise; since all elements match, the result is True.

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

Beginner
A 1 B 2 C Error D 3
Show answer & explanation

3

Negative indexing starts from the end; -1 refers to the last element, which is 3.

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

Beginner
A dict() B list() C set() D tuple()
Show answer & explanation

tuple()

The tuple() constructor takes an iterable (like a list) and returns a tuple.

Q7. Tuples are mutable in Python.

Beginner
A True B False
Show answer & explanation

False

Tuples are immutable; their elements cannot be changed after creation.

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

Beginner
A True B False
Show answer & explanation

True

Tuples can hold mixed data types, e.g., (1, 'hello', 3.14).

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

Beginner
A True B False
Show answer & explanation

True

The `in` operator works on tuples to test membership.

Q10. Tuples support item assignment like lists.

Beginner
A True B False
Show answer & explanation

False

Tuples are immutable and do not support item assignment (e.g., t[0] = 5 raises TypeError).

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.
Show answer & explanation

Tuples are immutable.

Tuples are immutable, meaning their elements cannot be changed after creation. They are ordered and can contain duplicates.

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)
Show answer & explanation

(1, 2, 3, 4)

The + operator concatenates two tuples, producing a new tuple with all elements from both.

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)
Show answer & explanation

(1, 2, 3, 1, 2, 3)

The * operator repeats the tuple elements the specified number of times.

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()
Show answer & explanation

index()

Tuples have an index() method that returns the first index of a specified value.

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)
Show answer & explanation

t.append(4)

Tuples are immutable and do not have an append() method. count() and index() are valid tuple methods.

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

Intermediate
A int B tuple C list D set
Show answer & explanation

tuple

Assigning comma-separated values without parentheses creates a tuple (tuple packing).

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
Show answer & explanation

1

Tuple unpacking assigns each element to a variable; a gets the first element, 1.

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

Intermediate
A t = (1,) B t = (1) C t = [1] D t = 1
Show answer & explanation

t = (1,)

A trailing comma is required to create a single-element tuple; (1) is just an integer in parentheses.

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

Intermediate
A 3 B 0 C 1 D 2
Show answer & explanation

1

The count() method returns the number of times a value appears; 2 appears once.

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, in 42 languages.

  • Chapter notes
  • Flashcards
  • Practice MCQs
  • Scored tests
  • Exam prep

Get Veda free See what students get

Free to start · No ads · Works in 42 languages