Python Tutorials
Basic

Data Structure and Data Types

String

List

Tuple

Set

Dictionary

Functions / Methods

Advance

Exception Handling

Python List and Tuple Difference


List and Tuple Difference

In Python, both list and tuple are used to store different data type items.

Difference
Difference List Tuple
Mutability The list is mutable.
Mutable means once you create any list in Python, then you can modify that list (add, remove or update the list items).
The tuple is immutable.
Immutable means once you create any tuple in Python, then you can not modify that tuple (adding, removing or updating the tuple items is not possible).
Syntax To create a list in Python, use the square ([]) brackets. To create a tuple in Python, use the parenthesis (()).
Speed Python list iteration is time-consuming. Python tuple iteration is comparatively faster than the list.
Memory Python list consume more memory. Python tuple consume less memory than a list.
Example
numbers_list = [
  0, 1, 2, 3, 4, 5
]

numbers_list.append(10)

print(numbers_list)
numbers_tuple = (
  0, 1, 2, 3, 4, 5
)



print(numbers_tuple)