Simple question - stock market simulation
anthra.norell at bluewin.ch
Mon Feb 9 17:29:25 CET 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.
If the subject is investment performance, surely your best bet is to
hand out piggy banks.
More information about the Python-list