Python Forum

Full Version: Unexpected input within an if/elif statement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
While trying to implement a simple if/elif statement, I'm getting an assault of errors that I don't understand. Hopefully, you will read my code and tell me what I'm doing wrong, I think I'm missing something basic. I have a function called "Stats" that displays the user's stats. By choosing an advantage that user can upgrade one of the three stats (health, power, luck).
if advantage == 1:
    BaseHealth = 150
Stats()

elif advantage = 2:
BaseLuck = 150
Stats()

elif advantage == 3:
BasePower = 150
Stats()
Thanks for your time
The indentation is wrong.
if advantage == 1:
    BaseHealth = 150
    Stats()
 
elif advantage = 2:
    BaseLuck = 150
    Stats()
 
elif advantage == 3:
    BasePower = 150
    Stats()
(May-12-2018, 03:47 AM)fier259 Wrote: [ -> ]I'm getting an assault of errors that I don't understand.
Please, always post the entire traceback that you get. We need to see thе whole thing.
Take a time to read What to include in a post