Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread Cameron Simpson
On 27May2014 15:27, Degreat Yartey yarteydegre...@gmail.com wrote: I am studying python on my own (i.e. i am between the beginner and intermediate level) and i haven't met any difficulty until i reached the topic 'Generators and Iterators'. I need an explanation so simple as using the expression

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread Degreat Yartey
I am completely new to programming! On May 27, 2014 10:54 PM, R. Alan Monroe amon...@columbus.rr.com wrote: I need an explanation so simple as using the expression 'print ()', in this case 'yield'. Python 2.6 here! Ever write any C programs with static variables? Generators can be

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread Degreat Yartey
I really love this explanation... that means functions just run till it finishes its duty, then return...and generators just generate one at a time until the 'for' statement asks for __next__(). On May 28, 2014 8:37 AM, Cameron Simpson c...@zip.com.au wrote: On 27May2014 15:27, Degreat Yartey

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread Degreat Yartey
This means that '...' should generally contain a manipulator then yield generates from where it stopped...*getting it* Thanks for the explanation though! Its seems so simple to digest. Thank you... On May 28, 2014 1:09 AM, Danny Yoo d...@hashcollision.org wrote: On Tue, May 27, 2014 at 12:27

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread Alan Gauld
On 28/05/14 11:52, Degreat Yartey wrote: This means that '...' should generally contain a manipulator then yield generates from where it stopped...*getting it* It would help if you deleted the irrelevent bits so we can see which '...' you mean. I'm guessing it was this comment, right at the

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread Hilton Fernandes
Dear all, i'd like to thank every answer in this list. Alan Gauld is a fine writer of excellent introductory material on Pyton, and so are a few other members of this list. So, it is always enlightening to read what you all write. Keep up the good work. All the best, hilton On Wed, May 28,

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread wesley chun
I'm not going to add too much more to all the replies here already, but one of my students did record a quick 6-minute video in one of my courses where i explained generators. hopefully you find it useful! It's about halfway down the page at http://cyberwebconsulting.com. (Also for those learning

[Tutor] I am having difficulty grasping 'generators'

2014-05-27 Thread Degreat Yartey
I am studying python on my own (i.e. i am between the beginner and intermediate level) and i haven't met any difficulty until i reached the topic 'Generators and Iterators'. I need an explanation so simple as using the expression 'print ()', in this case 'yield'. Python 2.6 here! Thank you.

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-27 Thread R. Alan Monroe
I need an explanation so simple as using the expression 'print ()', in this case 'yield'. Python 2.6 here! Ever write any C programs with static variables? Generators can be explained in those terms if you have experience with them. Alan ___ Tutor

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-27 Thread Danny Yoo
On Tue, May 27, 2014 at 12:27 PM, Degreat Yartey yarteydegre...@gmail.com wrote: I am studying python on my own (i.e. i am between the beginner and intermediate level) and i haven't met any difficulty until i reached the topic 'Generators and Iterators'. I need an explanation so simple as

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-27 Thread Marc Tompkins
On Tue, May 27, 2014 at 12:27 PM, Degreat Yartey yarteydegre...@gmail.com wrote: I am studying python on my own (i.e. i am between the beginner and intermediate level) and i haven't met any difficulty until i reached the topic 'Generators and Iterators'. I need an explanation so simple as