DEV Community

Discussion on: The 35 Words You Need to Python

Collapse
 
ornataweaver profile image
Ornataweaver

"What you’ll notice is that returnterminates a function at the moment it’s evaluated. Anything below that point in the function essentially doesn’t exist (with one exception, the finally block inside an exception handler). "

In "if", "elif" and "else" blocks it's the same story.

Collapse
 
yawpitch profile image
Michael Morehouse

Not sure what the issue is with the first paragraph. Can you expand?

As for if/elif/else, I don't see quite the same ambiguity there as it's worded, since neither an elif or an else is required to appear after the if. An if with neither an elif or an else is valid, but a try cannot appear without either an except, a finally, or both ... so all I'm trying to communicate with if/elif/else is that those three keywords must appear in that order, if before elif, elif before else.

Collapse
 
ornataweaver profile image
Ornataweaver

My bad, I should have paid more attention to "at the moment it’s evaluated."
Sorry for taking your time.
Thanks again.