How to create a function in Python that makes objects (i.e lists) -
i couldn't find guide me out in area. hoping me explain kind of programming in python. trying write code goes this:
def runner(): g in range(somerange): makelistobjectcalled 'listnumber'+'g' listnumberg.append(g*500000 or whatever) print listnumberg #so have somerange amount of lists #named 0,1,2,3...(up somerange) through i think can done classes (in fact i'm guessing thats they're for...) i'm not sure. lay me down clarifications please?
it looks want list of lists.
def runner(): lists = [] g in range(somerange): lists[g] = [] lists[g].append(g*500000 or whatever) print lists[g] #this way, have lists[0], lists[1], ..., lists[somerange]
Comments
Post a Comment