Making y always equal to x
How can i make y to always be equal to x, without having to manually adjust for y
Thanks for reaching out!
The idea of
y always being equal to
x implies that
x should always reference the same object in the memory. However, since integers are immutable objects in Python, any modification to
x would affect its identity. Therefore, upon changing the value of
x would no longer reference the same object.
In short, you can't make
x always reference the same object upon modifying the variable