Python if-elif-else

some_var = 5
 
if some_var > 10:
    print("some_var > 10.")
elif some_var < 10:    # elif is optional
    print("some_var < 10.")
else:                  # else is optional
    print("some_var = 10.")

Leave a Reply

Your email address will not be published. Required fields are marked *