
Asked in TCS and 17 others
What are the differences between tuples and lists in Python?

Lists are mutable, ordered collections; tuples are immutable, ordered collections in Python.
Mutability: Lists can be modified (e.g., list.append(1)), while tuples cannot (e.g., tuple[0] = 1 raises an ...read more
The primary difference between tuples and lists is that tuples are immutable as opposed to lists which are mutable. Therefore, it is possible to change a list but not a tuple.
The primary difference between tuples and lists is that tuples are immutable as opposed to lists which are mutable. Therefore, it is possible to change a list but not a tuple.
The contents of a tuple c...read more
list is mutable and tuple is immutable.
list is slower when compared to tuple.
Both list and tuple elements may be tuple,string,dict,int.

Interview Questions from Popular Companies










Reviews
Interviews
Salaries
Users

