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:
The error I recieve:
I’ve compared my codes with the tutorial and it is almost exactly identical
Heres the video for reference: https://youtu.be/kDdTgxv2Vv0?t=1843
edit: This is what's stated in the "problems" tab in VS code (line 15 in VS code being Line 8 in here, since I cut some of the code out ofc):
The part of my code which recieves the error looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
player_choice = input () if player_choice = = '1' : monster[ 'health' ] = monster[ 'health' ] - player[ 'attack' ] player[ 'health' ] = player[ 'health' ] - monster[ 'attack' ] edit 2 : Nvm I solved i, forgot parantheses at player health print (monster[ 'health' ]) print (player[ 'health' ] elif player_choice = = '2' : print (Heal Player) else : print (Invalid Input ) |
1 2 3 |
elif player_choice = = '2' : ^ SyntaxError: invalid syntax |
Heres the video for reference: https://youtu.be/kDdTgxv2Vv0?t=1843
edit: This is what's stated in the "problems" tab in VS code (line 15 in VS code being Line 8 in here, since I cut some of the code out ofc):
1 |
"message" : "invalid syntax (<unknown>, line 15)" |