Variables in python are effectively pointers in practical use. The assignment operator “=” automatically creates an effective pointer - unless it is a basic type (called an immutable). Examples of basic data types include: int, float, str and bool. Assignment of these data types do not use pointers .
On the other hand, pointers are used when assigning: lists, dicts, class objects etc.
This is frustrating when I need to assign variables of the latter type (list for example) by value.
For example:
background = [1, 1, 0, 2, 2]
screen = background
background[2] = 8
print(background) # [1, 1, 8, 2, 2]
print(screen) # [1, 1, 8, 2, 2]
# However, I did NOT want screen to change
Can this be done?