Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
How indentation in python is strict. else if would make unnecessary indentation level.
if x < 0:
sth()
else:
if x > 0:
sth_else()
else:
sth_elsier()
Is the only proper Python use of else if.
See: http://stackoverflow.com/a/3742602/... -
Leya17718y@Lythenas This should explain why Python needs the elif statement http://stackoverflow.com/a/13096142
-
Lythenas2428yI know why it needs something like elif. But why not just call it "else if" or "elseif". It bothers me a little bit because I think it makes the code lass readable.
-
Both else and elif are 4 letters. And ut was used in other languages before. Never ever have I seen elseif. And else if is wrong with Python syntax and as Python is designed to have only one obvious way of doing things it is wrong at the beginning. So here. Thats why elif in my opinion.
-
@Lythenas well... Thats php. Best proof that you do not have to be beautiful to be popular xD
-
@afrometal @Lythenas lua has elseif too. I like elif because it is shorter. Less keystrokes.
Related Rants
Inventor of Python: "Let's make the syntax annoyi....different. Let's make it different."
undefined
python
syntax