In Python , why do we use the elif ? and what is it ?
I was learning about the else if commands and stumbled upon the elif and confused about it
>Solution :
It sounds as if you are familiar with an "Else if" statement. An "Elif" statement is the "Else if" version of python.
Take the following Java code:
if(1 < 2) {
System.out.println("if statement");
} else if(3 > 4) {
System.out.println("else if statement");
}
Would turn into the following Python code:
if 1 < 2:
print("if statement")
elif 3 > 4:
print("else if statement")