Re: error handling in user input: is this natural or just laborious

2006-10-08 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, James Stroud > wrote: > > >>Patently. Tabs should be reserved for tables, for which tabs were named. >>If they were meant to be used for indenting, they would have been >>named "indenters". > Or possibly "inds", in a similarly abbrevi

Re: error handling in user input: is this natural or just laborious

2006-10-07 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, sam wrote: > i'm still in the early stages, and am trying to code something simple > and interactive to get the percentages of the portfolio in the five > different investment categories. i thought i'd get in with the error > handling early so if someone types in so

Re: error handling in user input: is this natural or just laborious

2006-10-07 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, James Stroud wrote: > Patently. Tabs should be reserved for tables, for which tabs were named. > If they were meant to be used for indenting, they would have been > named "indenters". Really? I thought they were for tabulators

Re: error handling in user input: is this natural or just laborious

2006-10-07 Thread sam
a huge amount to think about there. special thanks to james for taking the time to make such detailed responses. the problem is that even though nested loops and the like place a heavy analytical burden on the programmer (i.e. me) as he tries to remember what does what, conceptualizing a program

Re: error handling in user input: is this natural or just laborious

2006-10-07 Thread bruno de chez modulix en face
sam a écrit : (snip) > i'm still in the early stages, and am trying to code something simple > and interactive to get the percentages of the portfolio in the five > different investment categories. i thought i'd get in with the error > handling early so if someone types in something wrong (like a

Re: error handling in user input: is this natural or just laborious

2006-10-07 Thread Steven D'Aprano
On Fri, 06 Oct 2006 17:19:01 -0700, sam wrote: > gosh, a lot of work to get some input. i must be missing something, > though this is a lot better than what i had before... Welcome to the real world of programming. Writing your algorithms is, generally, the easy part. Handling data input and outp

Re: error handling in user input: is this natural or just laborious

2006-10-06 Thread James Stroud
James Stroud wrote: > sam wrote: > >> this does what i want, though i don't like the inner while loop having >> to be there [snip] > A little cleaner. Now, lets tighten it up a bit more, and put nested > loops into functions. Im getting rid of keeping track of the running > total, that will clea

Re: error handling in user input: is this natural or just laborious

2006-10-06 Thread James Stroud
sam wrote: > this does what i want, though i don't like the inner while loop having > to be there > > > def get_pct(): > while True: > pct_list=[['cash', 0], ['bond', 0], ['blue', 0], ['tech', 0], > ['dev', > 0]] > total=0 > for i in range(len(pct_

Re: error handling in user input: is this natural or just laborious

2006-10-06 Thread sam
this does what i want, though i don't like the inner while loop having to be there def get_pct(): while True: pct_list=[['cash', 0], ['bond', 0], ['blue', 0], ['tech', 0], ['dev', 0]] total=0 for i in range(len(pct_list)):

Re: error handling in user input: is this natural or just laborious

2006-10-06 Thread sam
you're right, of course. it occurred to me that, even if it were manageable for a few items, it would quickly become absurd as the number of items grew. this: def get_pct(): while True: pct_list=[['cash', 0], ['bond', 0], ['blue', 0], ['tech', 0], ['dev', 0]]

Re: error handling in user input: is this natural or just laborious

2006-10-06 Thread James Stroud
James Stroud wrote: > sam wrote: > >> hi all, >> >> i'm starting to put together a program to simulate the performance of >> an investment portfolio in a monte carlo manner doing x thousand >> iterations and extracting data from the results. >> >> i'm still in the early stages, and am trying to co

Re: error handling in user input: is this natural or just laborious

2006-10-06 Thread James Stroud
sam wrote: > hi all, > > i'm starting to put together a program to simulate the performance of > an investment portfolio in a monte carlo manner doing x thousand > iterations and extracting data from the results. > > i'm still in the early stages, and am trying to code something simple > and inte

error handling in user input: is this natural or just laborious

2006-10-06 Thread sam
hi all, i'm starting to put together a program to simulate the performance of an investment portfolio in a monte carlo manner doing x thousand iterations and extracting data from the results. i'm still in the early stages, and am trying to code something simple and interactive to get the percenta