An
elif
condition cannot exist without anif-else
statement.
An elif
condition cannot exist without a preceding if
statement.
For example
if 0:
pass
elif 1:
print("no else statement")
But that question implies that a elif
condition isn’t possible unless the block ends with a else
statement:
if 0:
pass
elif 0:
pass
else:
print("with else statement")