Weird behaviour of code in string slicing in Python

后端 未结 0 1411
天涯浪人
天涯浪人 2020-12-02 01:15

My code:

a=[1,2,3,4,5]
a[:4],a[4:]=a[4:],a[:4]
print(a)
Output:
[5,5,1,2,3,4]

So,I tried debugging it to find what is happening in the inside
#a[:4],a[4:]=a[         


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