Simple question - stock market simulation

cptn.spoon cptn.spoon at gmail.com
Sun Feb 8 23:50:49 EST 2009


I'm trying to create an incredibly simple stock market simulator to be
used in a childrens classroom and I'm wondering whether someone can
point me in the right direction.

I basically want to be able to have a stock struct as follows:

StockName = "Test"
StockPriceList = (12,13,12,10,10,8,10)
StockRisk = 0.15
StockQty = 2000

And then have a StockMarket struct that can contain 1 to many Stocks.
I then want to be able to iterate through the stocks to perform
operations as such:

for Stock in StockMarket:

I'm not asking for tips on the program itself, I just can't figure out
how to get the data structures in place. Would I use Classes or would
I use dictionaries? Am I completely off the mark with this?

Apologies for such a rudimentary question...I'm very new to all this.



More information about the Python-list mailing list