Home / Expert Answers / Computer Science / python-11-9-lab-guess-the-random-number-given-the-code-that-reads-a-list-of-integers-complete-th-pa335

(Solved): python 11.9 LAB: Guess the random number Given the code that reads a list of integers, complete th ...



python

11.9 LAB: Guess the random number
Given the code that reads a list of integers, complete the number_guess() function, which s

11.9 LAB: Guess the random number Given the code that reads a list of integers, complete the number_guess() function, which should choose a random number between 1 and 100 by calling random.randint 0 and then output if the guessed number is too low, too high, or correct. Import the random module to use the random.seed 0 and random.randint() functions. - random.seed(seed_value) seeds the random number generator using the given seed_value. - random.randint \( (a, b) \) returns a random number between \( a \) and \( b \) (inclusive). For testing purposes, use the seed value \( 900 \mathrm{~ , ~ w h i c h ~ w i l l ~ c a u s e ~ t h e ~ c o m p u t e r ~ t o ~ c h o o s e} \) runs. Ex: If the input is: \( \begin{array}{llll}32 & 45 \quad 48 \quad 80\end{array} \) the output is: 32 is too low. Random number was \( 80 . \) 45 is too high. Random number was \( 30 . \) 48 is correct! 80 is too low. Random number was \( 97 . \) \begin{tabular}{l|l} LAB & 11.9.1: LAB: Guess the random number \end{tabular} main.py Load default template... \( 0 / 10 \) \( 3936302637016.4 \times 3297 \)


We have an Answer from Expert

View Expert Answer

Expert Answer


input code: output: code: import random """make a function""" def number_guess(num): """generate a number""" guess=random.randint(1,100)
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe