Hey, quick heads-up on the code. We should change the condition to "if guess == 6: " at the end.
Right now, with guess != 6, if a player actually hits the correct number 6 on their 5th try, the logic flips, and the game still tells them 'You ran out of tries'. Swapping it to == 6 will fix this glitch and make the win fair!
guess = 0
tries = 0
while guess != 6 and tries < 5:
guess = int(input('Guess the number: '))
tries = tries +1
if guess ==6:
print('you got it')
else:
print('no more tries')
Hey, quick heads-up on the code. We should change the condition to "if guess == 6: " at the end.
Right now, with guess != 6, if a player actually hits the correct number 6 on their 5th try, the logic flips, and the game still tells them 'You ran out of tries'. Swapping it to == 6 will fix this glitch and make the win fair!
guess = 0
tries = 0
while guess != 6 and tries < 5:
guess = int(input('Guess the number: '))
tries = tries +1
if guess ==6:
print('you got it')
else:
print('no more tries')