On Tue, Jul 5, 2016 at 5:36 PM Michael Selik <michael.se...@gmail.com>
wrote:

> On Sat, Jul 2, 2016 at 8:29 AM Alan Gauld via Tutor <tutor@python.org>
> wrote:
>
>> 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.
>
> https://gist.github.com/selik/d8e0a7622ceff0fe8984a7d19d44bfca
>

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.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to