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
Post a Comment