This is my second day of learning python (I know the basics of C++ and some OOP.), and I have some slight confusion regarding variables in python.
Here is how I unde
When you store spam = 42 , it creates an object in the memory. Then you assign cheese = spam , It assigns the object referenced by spam to cheese. And finally, when you change spam = 100, it changes only spam object. So cheese = 42.
spam = 42
cheese = spam
spam
cheese
spam = 100
cheese = 42