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

  • Tuples are mutable, and lists are immutable.
  • Lists are ordered, and tuples are unordered.
  • Tuples are immutable, and lists are mutable.
  • Lists can store elements of different data types, while tuples cannot.
The correct option is 3. Tuples in Python are immutable, meaning their elements cannot be changed after creation, whereas lists are mutable and can be modified.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *