What happens when you assign the value of one variable to another variable in Python?

后端 未结 10 813
太阳男子
太阳男子 2020-11-30 00:54

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

10条回答
  •  醉梦人生
    2020-11-30 01:40

    What is happening in spam = 100 line is replacement of previous value (pointer to object of type int with value 42) with another pointer to another object (type int, value 100)

提交回复
热议问题