python中一次创建多个空列表,并对每个空列表赋值

n = 5
lists = [[] for _ in range(n)]

lists[0]=[1,2,3]

lists[1]=[4,5]

print(lists)

 

posted @ 2020-06-06 04:23  青女素娥  阅读(10814)  评论(0)    收藏  举报