List vs Tuples

Lists are mutable whereas Tuples are immutable.

list_string = ['some','list','elements']
tuple_string = ('some','tuple','elements')
print(f'this is a list: {list_string}\ttype = {type(list_string)}')
print(f'this is a tuple: {tuple_string}\ttype = {type(tuple_string)}')
# lists are mutable 
# let’s change 'some' to many in list
list_string[0] = 'many'
print(f'Changing element in list[mutable]: {list_string}\ttype = {type(list_string)}')
# lists are immutable 
# let’s change first element 'some' in tuple
tuple_string[0] = 'many'
# error: TypeError: 'tuple' object does not support item assignment
print(f'Changing element in tuples[immutable]: {tuple_string}\ttype = {type(tuple_string)}')