What is the difference between List and Tuple in Python?
Tuple is immutable data type while list is mutable. That means, that tuple cannot be modified after it is defined. List can be freely modified after its definition.
As a result tuple can be used as a key for set / dictionary while list cannot (tuple is hashable while list is not).

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Python quizzes
Sign Up Now
or Subscribe for future quizzes