Simple if-else question

alex23 wuwei23 at
Thu Oct 1 02:59:07 CEST 2009

dksr <dksre... at> wrote:
> Yes thats what I thought. for-else looks similar to if-else and in if-
> else, else part is executed only when if part is not executed, but in
> for-else it has entirely a different job.

If you think of if-else more in terms of the else-branch occurring
when the if-condition is no longer true (as opposed to 'not
executing'), they're a lot more similar in approach than different.

More information about the Python-list mailing list