On 28/08/12 16:51, Dharmit Shah wrote:

@Dave Angel : Thank you for the loop idea. It didn't strike me at all.

For some reason some beginners seem to find recursion a natural pattern.

Many others, including quite experienced programmers find it a mind
bending concept.
But as a general rule, where you want to repeat an naction a number of times thing loops. If you know in advance how many times to repeat (eg all the items in a list) think 'for' loops, if you don't know how often (eg until some input condition is met) think 'while' loops.

HTH,

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/









_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to