samedi 16 octobre 2021

Why does this line keep running?

def genieProcess():
  genieGame()
  guess1 = guesses('''What should I guess first?
> ''', 'Hint - It is a quote from the genie in Alladin')
  if guess1 == 'i cannot believe i am losing to a rug':
    print('''
''')
  else:
    guess2 = guesses('''What should I guess next?
> ''', 'Hint - Half of it can be solved alphaneumerically')
    if guess2 == 'i cannot believe i am losing to a rug':
      print('''
''')
    else:
      lastGuess()

Just for context, the guesses function allows the user to put in an input, and when the input is "i cannot believe i am losing to a rug," it is supposed to congratulate the user and end the program. However, even when the correct answer is inputed:

What should I guess first?
> i cannot believe i am losing to a rug
WOW I got it right!!!
What should I guess next?

It still runs the next part of the program which is for if you got it wrong. Please help.

Aucun commentaire:

Enregistrer un commentaire