ladarks7 ladarks7
  • 26-09-2021
  • Computers and Technology
contestada

How to limit the number of guesses in python

Respuesta :

Heather
Heather Heather
  • 26-09-2021

I thinkkkkk this is kind of what you are looking for?

while user != the_number:

   ...

   if count == 5:

       print("etc etc")

       break

else:

   print("You guessed it!!, the number is", the_number, "and it only"\

         " took you", count , "tries")

Basically if you have 5 guesses it'll break it and stop the guesses

Answer Link

Otras preguntas

PLEASE HELP ME-!!!…………………………….
Twin brothers, billy and bobby, can mow their grandparents lawn together in 69 minutes. Billy could mow the lawn by himself in 30 minutes less time that it woul
What major labor strikes took place in the late 1800s
How do you write this number using words? 190
I WILL MARK YOU BRAINLIEST, I NEED IT ASAP. A round pizza is 12 inches long. How many inches of stuffed crust do you need to put around the edge of the pizza? S
X-1 = 3 ---------- 7 4
How did the McDonald brothers lose the Mcdonalds business?
Hello! can you please, help me by finding some missing angles. the Question will be attached down Below: Thanks! with working out please so I can understand too
How did the Spanish-American War affect US power in Asia? A. The war with the Filipino rebels reduced US influence in Asia. B. The war gave the US more military
what are your plans for the next three years as a student