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

factor completely 6w^4 – 54w^2
what does monologues do
Describe the features of the rule of Julius Caeser
66.6% Written as a fraction
Who managed the Beatles
is tim as 11 cakes and mike has 7 and Emily has 11 more than time and mike combined how many does she have
Which sentence does not contain any errors in comma usage? A. The table was delivered in two, cardboard boxes. B. Sally has a new blue bedspread. C. It is, an o
Express the product of cos 30°and 45° in simple simplest radical form
A little more than 43 million households own dogs in the US. The rate of increase in dog ownership is 1.5% each year. Approximately how many households are expe
You have 1 case of soap bars and there are 150 bars in a case. You use 300 bars of soap per day. How many cases do you need to order to have enough for 7 days?*