8.21.2018

Python - Initializing Multiple Lists/Line

This is terribly ugly:
psData = []
nsData = []
msData = []
ckData = []
mAData = []
RData = []
pData = []
Is there a way to declare these variables on a single line?

Ans:down voteaccepted
alist, blist, clist, dlist, elist = ([] for i in range(5))

沒有留言:

張貼留言