Making y always equal to x
How can i make y to always be equal to x, without having to manually adjust for y
1 answers ( 0 marked as helpful)
Hey Adeolu,
Thanks for reaching out!
The idea of y always being equal to x implies that y and 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, y and x would no longer reference the same object.
In short, you can't make y and x always reference the same object upon modifying the variable x.
Kind regards,
365 Hristina