How to create multiple instances of a class?
control_reset at hotmail.com
Mon Mar 3 13:28:10 CET 2003
How do I create multiple instances of a class?
Lets say I have :
print "Index : %d", index
#creat multiple instances
nodes = 
for i in range (10):
nodes[i] = Node(i) <---
The above gives an error, saying something like arrayoutofbounds
Could you please advise.
Which basically boils down to the question on how to use list.
I think nodes = Node(i) will work but I dont want a list in
sequence. Basically what I want is a 2D array which I can access via
an index, eg node[i][j]. How do I do this?
More information about the Python-list