Copying list without modifying original inside function

后端 未结 0 1527
时光说笑
时光说笑 2020-11-27 15:30

I have the following function that takes a 2dlist as parameter

def listy(oldlist):
   newlist=oldlist.copy()
   for i in newlist:
       del i[0]
相关标签:
回答
  • 消灭零回复
提交回复
热议问题