What is the difference between a list and a tuple?
Model answer
A list is mutable: you can add, remove and change items. A tuple is immutable: once created it cannot change. Tuples are used for fixed groups of values and can be dictionary keys when their items are hashable. Lists use [] and tuples use ().
Learn this topic
What Is Python? Install It and Write Your First Program in the course Python for Beginners: Learn to Code with Real Projects.
Sign in to add your own answer.