0

Always True or False. How to fix it?

print ('Letter guessing game!') def checkGuess(): print('Guess a letter!') a = True guess = bool(input()) if guess == a: print ('Correct! You win!') else: print ('Wrong') if checkGuess() == False: [checkGuess() for _ in range(0,2)] else: pass I notice when i entered "if guess = ''a'': " Then its always wrong. Why is this? and if i just put 'a' its always true ><

15th Jul 2017, 1:43 PM
Iris Eye
Iris Eye - avatar
2 Respostas
+ 4
print ('Letter guessing game!') def checkGuess(): print('Guess a letter!') guess = str(input()) if guess == 'a': print ('Correct! You win!') else: print ('Wrong') if checkGuess(): [checkGuess() for _ in range(0,2)] else: pass
15th Jul 2017, 1:48 PM
Hatsy Rei
Hatsy Rei - avatar
0
try doing: if guess=='a'
15th Jul 2017, 1:48 PM
PierX
PierX - avatar