Nov-16-2019, 02:53 AM
You can't have an elif on it's own like that. Also, the condition for the if and the elif are the same. Here's how if/elif works:
if spam == 1: do_something() do_something('silly') elif spam == 2: spanish_inquisition() else: stop_it()Lines 2 and 3 only execute if the value of spam is 1. Line 5 only executes if the value of spam is 2. The last line executes if spam is neither 1 nor 2. All of this only works because of the indentation. The indentation indicates which code is executed by each of the statement. In between the if and the elif, everything must be indented, or you will get a syntax error.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures