You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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')
Activity
galjog12-blip commentedon Oct 4, 2026
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')