Why doesn't parallel swapping work with variables in python?

后端 未结 0 1696
暗喜
暗喜 2020-12-10 08:42
lst = [0,1,2,3,4]

lst[0], lst[4] = lst[4], lst[0]

print(lst) 
#[4, 1, 2, 3, 0]

But, when you assign them to a variable you get a different solutio

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