Syntax Error (elif statement)

I’m following a tutorial on youtube on how to code a very simple game.
The part of my code which recieves the error looks like this:

player_choice = input()

if player_choice == '1':
    monster['health'] = monster['health'] - player['attack']
    player['health'] = player['health'] - monster['attack']
elif player_choice == '2':
    print(Heal Player)
    print(Invalid Input)

The error I recieve:

    elif player_choice == '2':
SyntaxError: invalid syntax

I’ve compared my codes with the tutorial and it is almost exactly identical
Heres the video for reference:

Hey @web5654903635

You forgot a closing parentheses

right here:

1 Like

Thank you man, I do have another question, why does it tell me that the error was the elif statement on the exact same line as the statement was (line 15 in vs code) and not line 14 where the error truly was.

This topic was automatically closed 18 hours after the last reply. New replies are no longer allowed.