1

I assigned an int to a variable and I changed its value by *= operator. I realized, however, that Python3 assigned a new object to the variable not changing the original one.

This is the code I ran:

>>> a=5
>>> b=a
>>> a*=7
>>> print(a)
35
>>> print(b)
5

Is there a way that change the original object's value which the variable holds without assigning a new object by using *= operator?

0 Answers0