
January 17th, 2013, 05:14 PM
|
|
Contributing User
|
|
Join Date: May 2009
Posts: 313
  
Time spent in forums: 3 Days 23 h 14 m 11 sec
Reputation Power: 7
|
|
Quote: | my current work around is to do a list1=[] each iteration but that creates another instance of list1 | and removes/garbage collects the previous instance leaving one only. You can also do
Code:
## don't use "i" ,"l" or "o" as they look like numbers
for ctr in range(0, 100)):
list2.append([var1, var2])
##
## or list comprehension
list2 = [[var1, var2] for ctr in range(100)]
Last edited by dwblas : January 17th, 2013 at 05:17 PM.
|