Re: [Tutor] Function works one time then subsequently fails

2015-04-29 Thread Alan Gauld
On 29/04/15 04:58, Jim Mooney Py3winXP wrote: numbers = [] Note that you chose to make this global. def parse_string(math_string): """Input: A math string with a verbal or mathematical operation and two valid numbers to operate on. Extra numbers and operations are ignored. Out

Re: [Tutor] Function works one time then subsequently fails

2015-04-28 Thread Cameron Simpson
On 28Apr2015 22:27, Jim Mooney Py3winXP wrote: On 28 April 2015 at 21:27, Cameron Simpson wrote: At a first glance numbers is a global. It is reset to [] at program start, but never again. So you're appending to it forever. I have not investigated further as to how that affects your program's

Re: [Tutor] Function works one time then subsequently fails

2015-04-28 Thread Jim Mooney Py3winXP
On 28 April 2015 at 21:27, Cameron Simpson wrote: > At a first glance numbers is a global. It is reset to [] at program start, > but never again. So you're appending to it forever. I have not investigated > further as to how that affects your program's flow. > > Cheers, > Cameron Simpson > Took

Re: [Tutor] Function works one time then subsequently fails

2015-04-28 Thread Cameron Simpson
On 28Apr2015 20:58, Jim Mooney Py3winXP wrote: This is really puzzling me. I'm parsing a string to do some simple math operations and practice tossing functions around. My parser works on the first run, then it continually fails on the same input. [...] numbers = [] [...] def parse_string(m

[Tutor] Function works one time then subsequently fails

2015-04-28 Thread Jim Mooney Py3winXP
This is really puzzling me. I'm parsing a string to do some simple math operations and practice tossing functions around. My parser works on the first run, then it continually fails on the same input. """ Takes the name of a binary math operation and two numbers from input, repeatedly, and display