Re: [Tutor] iteration help

2015-08-20 Thread Mark Lawrence
On 20/08/2015 14:27, richard kappler wrote: Running python 2.7 on Linux While for and if loops always seem to give me trouble. They seem obvious but I often don't get the result I expect and I struggle to figure out why. Appended below is a partial script. Ultimately, this script will read a log

Re: [Tutor] iteration help

2015-08-20 Thread Alan Gauld
On 20/08/15 14:27, richard kappler wrote: While for and if loops always seem to give me trouble. A picky point, but it is conceptually very important. 'while' and 'for' are loops - because the loop back and repeat code. 'if' is not a loop. It is a selector. It only executes its code once but

Re: [Tutor] iteration help

2015-08-20 Thread Joel Goldstick
On Thu, Aug 20, 2015 at 9:27 AM, richard kappler wrote: > Running python 2.7 on Linux > > While for and if loops always seem to give me trouble. They seem obvious > but I often don't get the result I expect and I struggle to figure out why. > Appended below is a partial script. Ultimately, this sc

[Tutor] iteration help

2015-08-20 Thread richard kappler
Running python 2.7 on Linux While for and if loops always seem to give me trouble. They seem obvious but I often don't get the result I expect and I struggle to figure out why. Appended below is a partial script. Ultimately, this script will read a log, parse out two times from each line of the lo