I’m trying to get my game to tell the player how many chances they have left after every other turn. So for example, after the first try say “WARNING: you have x amount of tries left” and then “LAST CHANCE” when the final try comes.
I’m not sure if it’s possible to loop within a loop in the way that I’m trying to do it.
num = 2
guess = ''
guess_count = 0
guess_limit = 3
out_of_guesses = False
#make a loop to tell the player how many chances they have left
while guess != num and not(out_of_guesses):
print("WARNING: You only get THREE chances")
if guess_count < guess_limit :
guess = int(input('Guess a number between 1 and 10: '))
guess_count += 1
else:
out_of_guesses = True
if out_of_guesses:
print('Out of guesses. LOSER!')
else:
print('BINGO! The times the CHARM! WINNER!')
Thanks so much.
So I want the warning to change after every other turn unless the player guesses the correct number.
I hope this makes sense.