elif is short for “else if.” It means exactly what it sounds like: “otherwise, if the following expression is true, do this!”
if 8 > 9: print "I don't get printed!" elif 8 < 9: print "I get printed!" else: print "I also don't get printed!"
In the example above, the
elif statement is only checked if the original
if statement is
On line 2, fill in the
if statement to check if
answer is greater than 5.
On line 4, fill in the
elif so that the function outputs
answer is less than 5.