Python: Appending items to a list -


i want append few items within loop lists. doing is,

lista = [] listb = [] listc = [] in range(0,100):     lista.append(i) j in range(0,100):     listb.append(j) 

and on. there smarter way that?

the simple way achieve is:

lista = range(100) listb = range(100) listc = range(100) 

or

lista, listb, listc = [range(100) _ in range(3)] 

hope helps.


Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -