How to append to the end of an empty list?

前端 未结 8 1152
终归单人心
终归单人心 2020-11-27 13:13

I have a list:

list1=[]

the length of the list is undetermined so I am trying to append objects to the end of list1 like such:



        
8条回答
  •  萌比男神i
    2020-11-27 13:26

    use my_list.append(...) and do not use and other list to append as list are mutable.

提交回复
热议问题