+ 2
"elif" and "else"
When using "elif" and "else" after the "if" statement, do you have to indent the "elif" and "else"?
4 Answers
+ 6
Both elif and else will have the same indentation as if like below
a == 2
if (a==1):
print (a)
elif(a==2):
print (a)
else:
print (a)
+ 1
I'm sorry. The programming language is Python.