[Tutor] dont understand part of a code
michael.selik at gmail.com
Tue Jul 5 21:44:56 EDT 2016
On Tue, Jul 5, 2016 at 5:36 PM Michael Selik <michael.selik at gmail.com>
> On Sat, Jul 2, 2016 at 8:29 AM Alan Gauld via Tutor <tutor at python.org>
>> There are arguably easier ways of doing this
> I think you'll find that for-loops are preferable to while-loops. Here's
> an alternative implementation.
On further reflection, unfortunately a for-loop doesn't seem best for this
particular problem. I updated the gist, linked above. I wish the author had
chosen a better problem to emphasize Pythonic iteration.
More information about the Tutor