[CentralOH] Else Statements and Loops
Jay Shaffstall
jshaffstall at gmail.com
Fri Mar 20 18:15:39 CET 2015
I first discovered this language feature when teaching Python to
non-programming in my CS0 course. They'd use else on while loops, and it
would work. I've had to work to break them of the habit (since none of the
programs they're writing need that sort of 'finally' functionality on
loops).
Jay
On Fri, Mar 20, 2015 at 1:09 PM, Joe Shaw <joe at joeshaw.org> wrote:
> Hi,
>
> For reference, from the Python docs:
> https://docs.python.org/2/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops
>
> Joe
>
> On Fri, Mar 20, 2015 at 12:33 PM timothy spencer <
> smashing_good_show at hotmail.com> wrote:
>
>> So you can use an "else" statement with a for loop or a while loop. I
>> didn't know that. I came across that in Lutz's book. There was no mention
>> of that in Zed's book. I just thought that was pretty neat.
>> _______________________________________________
>> CentralOH mailing list
>> CentralOH at python.org
>> https://mail.python.org/mailman/listinfo/centraloh
>>
>
> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> https://mail.python.org/mailman/listinfo/centraloh
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/centraloh/attachments/20150320/aa2cdc42/attachment.html>
More information about the CentralOH
mailing list