1. Home
  2. Data Science
  3. Python
  4. What is the difference between a list and a tuple in Python?

Added 27 Jan 2024

What is the difference between a list and a tuple in Python?

  1. Lists are mutable, while tuples are immutable. Correct answer
  2. Lists are ordered, while tuples are unordered.
  3. Lists can contain any data type, while tuples can only contain numbers.
  4. Lists are faster than tuples.

Correct answer

A. Lists are mutable, while tuples are immutable.

16 views

MCQSEXAM

Explanation

Lists are mutable, while tuples are immutable. You can add, remove or change the items of a list after creating it, but a tuple's contents are fixed.

Both are ordered and both can hold any data type. Because tuples cannot change, they are slightly faster and can be used as dictionary keys.

Keep preparing with more Computer Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs