Programming · Flashcard

What is the key difference between a list and a tuple?

  • AA list is mutable while a tuple is immutable and cannot be changed after creation
  • BA list stores mixed data types while a tuple only accepts items of one single type
  • CA list is ordered while a tuple stores its items in an unpredictable internal order
  • DA list can be nested while a tuple is limited to a flat sequence of simple values

Why this is the answer

Lists are mutable, tuples immutable — that's the core distinction. Both can hold mixed types (typing isn't the difference), both preserve insertion order, and both support arbitrary nesting.

Official docs
Study in Gnoseed →