Differences
Differences
List Tuple
1 Lists are mutable(can be modified). Tuples are immutable(cannot be modified).
2 Iteration over lists is time-consuming. Iterations over tuple is faster
Lists are better for performing operations, such as insertion Tuples are more suitable for accessing
3
and deletion. elements efficiently.
4 Lists consume more memory. Tuples consumes less memory
5 Lists have several built-in methods. Tuples have fewer built-in methods.
6 Lists are more prone to unexpected changes and errors. Tuples, being immutable are less error prone
Lists maintain the Tuples maintain the order Sets do not maintain the Dictionaries do not maintain
order of the of the elements they order of the elements the order of the elements
elements they contain they contain they contain.
contain.
Lists can be Tuples can be accessed Sets cannot be accessed Dictionaries cannot be
accessed by index by index by index accessed by index
Lists can contain Tuples can contain Sets cannot contain Dictionaries cannot contain
duplicate duplicate elements duplicate elements duplicate elements
elements
Lists can be Tuples can be accessed Sets cannot be accessed Dictionaries cannot be
accessed by index by index by index accessed by index