New course! Every coder should learn Generative AI!
Try a free lesson0
How can we understand and use elif statement properly
It is easy learning Boolean logic and else-statement along with forgetting in near days
1 Answer
+ 1
elif or else if statements is the same as:
if (conditiona) {
} else {
if (conditionb) {
code goes here..
}
}
elif/ else if statement:
if (conditiona) {
} else if (conditionb) {
code goes here
}
So conditiona should be false other wise it won't go into the else if