+ 2
Colon
Y we need to use colon for if statement and can we use else if instead of elif statement
2 Antworten
+ 7
In ""Python"" We need to use colon after if and Elif statements as it is in python Syntx :
if (conditions):
##
else :
##
just like we use curly braces in java script
if (conditions){
##
} else {
##
}
And sorry no u cant use else it instead of Elif as in Python else if is regarded as Elif ,just the short form.
+ 2
Thanks bro