Discover the answers you need at Westonci.ca, a dynamic Q&A platform where knowledge is shared freely by a community of experts. Discover reliable solutions to your questions from a wide network of experts on our comprehensive Q&A platform. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform.

What is elif? How does it work in python?

Sagot :

it is the condition used after the if condition. say you use the if condition and you need to add another outcome, instead of using the if condition again, you’d use elif and end it with the else command.

example:

if num == 10:
print (“correct”)

elif num > 10:
print (“too high”)

else:
print (”too low”)

hope this helps :]
Use the elif condition is used to include multiple conditional expressions after the if condition or between the if and else conditions