[Tutor] trivial simple program..can it be made more concise?

2015-02-13 Thread steve10brink
Hi all, I was playing with Python tonight and created a simple program that outputs numbers counting up then counting down all on the same terminal line. The code is as follows: # a = 32 #number to count up to for i in rang

Re: [Tutor] How does this work (iterating over a function)?

2014-07-09 Thread steve10brink
- Original Message - I guess my higher level question is: "what makes this function iterable?" and the answer appears to be the fact that it uses a generator instead of a return function. Is that correct? -Steve Tenbrink

[Tutor] How does this work (iterating over a function)?

2014-07-09 Thread steve10brink
Greetings, I've been learning Python concepts for about 6 months now and was doing okay with most of these. However, I ran into a fairly simple program developed by Mark Pilgrim in his "Dive Into Python" text that puzzles me and am hoping some of you can explain how this works. He is creating