dimanche 27 juin 2021

Mastermind Python

Im currently working on an assignment of mastermind mini game on python, but for the code below, when i try to run it, it shows that the first line of my if statement ":" invalid syntax, but in previous lines i had something similar too but that didn't face any problem

     while True:
        try_again = str(input('Do you want to try again?[Y/N]: ')
        if try_again.lower() == 'y':
            print('Alright ', user_name, " let's try again!")
            break

        elif try_again.lower() == 'n':
            break

        else:
            print("Sorry, I don't understand, please type Y/N")
            continue

Aucun commentaire:

Enregistrer un commentaire