DEV Community

Discussion on: The `else if` Keyword Doesn’t Exist in Java

Collapse
 
silwing profile image
Silwing

I was just wondering to myself why python would have a separate elif keyword. But of course it makes sense because of whitespace having meaning in python.
Thanks!

Collapse
 
donut87 profile image
Christian Baer

Quote from python documentation to back me up on this:

The keyword ‘elif’ is short for ‘else if’, and is useful to avoid excessive indentation.