This forum is now read-only. Please use our new forums at discuss.codecademy.com.
what's the difference between "else if" and "elif" ?
what’s the difference between else if and elif ?
I was stopped here.
when I changed from *”else if”* to *”elif”* the program works.
why this happen?
is there any difference between the *”else if”* and *”elif”*
def shut_down(s):
if s == 'yes':
return "Shutting down"
else if s == 'no':
return "Shutdown aborted"
else :
return "Sorry"
Answer 5398ac1b282ae333b4000c78
Answer 5366beb47c82ca7928000f88
0 votes
elif is what python recognizes as else if so there is no difference
3 comments
Thank you for your help, but the problem is when I change “elif” to “else if” it will not work.

They are the same things, but python doesn’t understand “else if”. “else if” is syntax for another language (C++ as an example), while “elif” is syntax for Python!

Yeah so elif = else if BUT use elif NOT else if!!! Hope this helps!!! :)
1 comments
Also Simeng, you need to indent the if, elif, and else statements otherwise it wont work!!! :)