Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When I thought about this, I first agreed, then I thought that from the perspective of the interpreter it is else as in checks the condition and then goes to else if the condition is false. So I think it is not so much unintuitive, as it is consistent in a not immediately intuitive way.


Agree completely. I think for-else is same as if-else in that if the condition satisfies then it executes the main loop and if not it executes the 'else'.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: