Came across below lines of codes:
first_names = ['Fred', 'George', 'Bill']
last_names = ['Smith', 'Jones', 'Williams']
name_tuple = (first_names, last_names)
first_names.append('Igor')
#name_tupple why this output
#(['Fred', 'George', 'Bill', 'Igor'], ['Smith', 'Jones', 'Williams'])
- If tuple is immutable why tuple referenced get change on appending new item to list?
i know tuple have reference of list and list is immutable in python.
why dont make tuple a copy of elements that can be constant through out?