MemotivaBuilt-in data types

What is the difference between a list and a tuple?

Built-in data types

Audio flashcard · 0:14

Nortren·

What is the difference between a list and a tuple?

0:14

Lists are mutable, tuples are immutable. Lists use square brackets, tuples use parentheses or no brackets at all. Tuples are slightly more memory efficient and can be used as dictionary keys or set elements because they are hashable. Lists support more operations like append and extend.
docs.python.org