When you're learning about lists and tuples in programming, it's important to get what mutability means.
What is Mutability?
Lists:
shopping_list = ["milk", "eggs", "bread"]
shopping_list.append("butter") # Mutable: Now the list has "butter" too.
Tuples:
prize_team = ("Alice", "Bob", "Charlie")
# prize_team[1] = "David" # This will cause an error! Tuples cannot be changed.
So, to sum it up:
Lists can be changed, but tuples are fixed!
When you're learning about lists and tuples in programming, it's important to get what mutability means.
What is Mutability?
Lists:
shopping_list = ["milk", "eggs", "bread"]
shopping_list.append("butter") # Mutable: Now the list has "butter" too.
Tuples:
prize_team = ("Alice", "Bob", "Charlie")
# prize_team[1] = "David" # This will cause an error! Tuples cannot be changed.
So, to sum it up:
Lists can be changed, but tuples are fixed!