Re: Simple question - stock market simulation

2009-02-10 Thread Hendrik van Rooyen
"cptn.spoon" wrote: On Feb 9, 6:48 pm, "Hendrik van Rooyen" wrote: >> No. >> At this level, just use a list of instances of your Stock class. >> >> - Hendrik > >How do I get a list of instances of a particular class? Is there a way >to do this dynamically? Yes there is. First make an empty list

Re: Simple question - stock market simulation

2009-02-09 Thread cptn.spoon
On Feb 10, 10:26 am, Robert Kern wrote: > On 2009-02-09 17:10, cptn.spoon wrote: > > > > > On Feb 9, 6:48 pm, "Hendrik van Rooyen"  wrote: > >> "cptn.spoon"  wrote: > > >> On Feb 9, 3:58 pm, Paul Rubin  wrote: > > >>> Thanks Paul! I thought this might be the case. So

Re: Simple question - stock market simulation

2009-02-09 Thread Robert Kern
On 2009-02-09 17:10, cptn.spoon wrote: On Feb 9, 6:48 pm, "Hendrik van Rooyen" wrote: "cptn.spoon" wrote: On Feb 9, 3:58 pm, Paul Rubin wrote: Thanks Paul! I thought this might be the case. So how would I get the StockMarket class instance to contain many Stoc

Re: Simple question - stock market simulation

2009-02-09 Thread cptn.spoon
On Feb 9, 6:48 pm, "Hendrik van Rooyen" wrote: > "cptn.spoon" wrote: > > On Feb 9, 3:58 pm, Paul Rubin wrote: > > >Thanks Paul! I thought this might be the case. So how would I get the > >StockMarket class instance to contain many Stock class instances and > >then b

Re: Simple question - stock market simulation

2009-02-09 Thread cptn.spoon
On Feb 10, 3:29 am, Anthra Norell wrote: > cptn.spoon wrote: > > 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 str

Re: Simple question - stock market simulation

2009-02-09 Thread Anthra Norell
cptn.spoon wrote: 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

Re: Simple question - stock market simulation

2009-02-09 Thread Hendrik van Rooyen
"cptn.spoon" wrote: On Feb 9, 3:58 pm, Paul Rubin wrote: >Thanks Paul! I thought this might be the case. So how would I get the >StockMarket class instance to contain many Stock class instances and >then be able to iterate through them? I'm guessing the basic struc

Re: Simple question - stock market simulation

2009-02-08 Thread Terry Reedy
cptn.spoon wrote: On Feb 9, 3:58 pm, Paul Rubin wrote: "cptn.spoon" writes: 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 ma

Re: Simple question - stock market simulation

2009-02-08 Thread Paul Rubin
"cptn.spoon" writes: > def __init__(self, stockname, stockpricelist[], stockrisk, > stockqty): ... You would say just stockpricelist rather than stockpricelist[], but other than that your class def looks good. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple question - stock market simulation

2009-02-08 Thread cptn.spoon
On Feb 9, 3:58 pm, Paul Rubin wrote: > "cptn.spoon" writes: > > 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

Re: Simple question - stock market simulation

2009-02-08 Thread Paul Rubin
"cptn.spoon" writes: > 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? Typically you would use a class for the multi-fielded data structure;

Simple question - stock market simulation

2009-02-08 Thread cptn.spoon
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) Stoc