List vs Tuple in Python

Here we discuss the top 5 key differences between List and Tuple

Lists are mutable, which means that you can add, remove, or modify elements in a list after it has been created.

Mutability: List

tuples are immutable, which means that once a tuple is created, you cannot add, remove, or modify elements within it.

Mutability: Tuple

Another difference between lists and tuples is their syntax. Lists use square brackets ([ ])

Syntax: List

while tuples use parentheses (()).

Syntax: Tuple

lists use more memory as compared to tuple

Memory: List

tuple uses less memory as compared to the list

Memory: Tuple

List is slower as compared to the tuple

Performance: List

tuple is faster than the list.

Performance: Tuple