Why Am I Getting ELIF Invalid Syntax Error?

You need to firstly type “if” and the “elif”. So it should be something like that:

def choice(game):           #CHOOSING GAME
while game > 3 or game < 1:
    print("\nSomething went wrong, enter game you want again (only numbers 1, 2, 3!")
    game = int(input("--> "))
    if game == '1': #bug here
        print("You chose Coin flip game")
        os.system('python coinflip.py')
    elif game == '2': #and here
       print("You chose Horse racing game")
        os.system('python horseracing.py')
    elif game == '3': #and here
        print("You chose Loto game")
        os.system("python loto.py")

Leave a Comment