jeudi 20 juin 2019

There is a syntax error in my program. In the if statement

I was trying some code out and I encountered this syntax error.

I tried adding space between Pokemon and :
But the arrow points to the letter 'n'
Also, I am using python 3.7.3 the (current latest version)

 print("Let's Play...") #greet
 print('POKÉMON')  #greet
 def choose_game(): #choose game function
     game_type = input("Which game do you want to play?\n a)Odd Pokémon\n b)Pokénary\n<> ")
     if game_type == a or game_type == Odd Pokémon :
         print("gdf")


 choose_game()

 File "Project_1.py", line 5
     if game_type == a or game_type == Odd Pokémon:
                                                 ^
 SyntaxError: invalid syntax

I used this code to say that if the variable game_type = a or Odd game it has to go into the if statement.

Aucun commentaire:

Enregistrer un commentaire