Python: copy of a variable

后端 未结 5 1247
[愿得一人]
[愿得一人] 2020-12-10 13:33

Is there a way in to make copy of a variable so that when the value changes of variable \'a\' it copies itself to variable \'b\'?

Example

a=\'hello\'         


        
5条回答
  •  春和景丽
    2020-12-10 14:09

    You are asking if it is possible to create a reference to a variable and hold in another variable. No, this is not possible. See e.g. Create a reference to a variable (similar to PHP's "=&")?

提交回复
热议问题