(Beginner) Why does the temporary variable change in example 1, but not in example 2?

后端 未结 0 1406
暖寄归人
暖寄归人 2021-01-21 08:25

These are the two examples, could someone help me by explaining?

Example 1

v1=list(range(5))
v1temp=v1
v2=1

def ext(x,y):
    return x.append(y)

ext(v1,v         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题