Write a program named guess_number.py. Use NumPy to generate a random number between 1 and 100. Accept int input and ask user to guess number. Inform if high or low. Exit when entered number correct. Tell user how many tries it took to guess number.

Respuesta :

Answer:

download the .txt file and change the file name to guess_number.py then run it in a python interpreter. I used Python 3.9.6 for this project and I used Visual Studio Code as my IDE.

Explanation:

The code has comments that tell you what is happening.

I hope this helped :) If it didn't please let me know what went wrong so I can fix it.

Ver imagen RemielUri

In a program named guess_number.py. Use NumPy to generate a random number between 1 and 100. Accept int input and ask the user to guess the number.

What are programming used for?

The motive of programming is to discover a series of commands with the intention to automate the overall performance of a task (which may be as complicated as a running system) on a computer, regularly for fixing a given problem.

  1. Import NumPy as np def main():
  2. # Random variety Random Number = np.random.randint(1, 100) # A begin variable Start = Try.
  3. # This value is the handiest used to decide if the person has been known that the fee is excessive or low   High Or Low Message Displayed Already = False # Amount of guesses that the person were given incorrectly.
  4. Guess Gotten Wrong 0 # The general quantity of guess AmountOfGuesses = 0
  5. # Beginning of some time loop in order to maintain the software jogging till the person guesses the random variety print("The fee is excessive")
  6. High Or Low Message DisplayedAlready = True Elif RandomNumber <= forty nine and High OrLow MessageDisplayedAlready == False:

           print("The fee is low")

           High Or Low Message Displayed Already = True.

  1. AmountOfGuesses += print("Wrong! You have gotten " + str(GuessGottenWrong) + " guesses incorrect.
  2. main()

Read more about the program :

https://brainly.com/question/1538272

#SPJ2