Computers and Technology

Define a function called guessnumber that implements the following game, in which the computer will: • think of a random number in the range 0-50. (hint: use the random module.) • repeatedly prompt the user to guess the mystery number. • if the guess is correct, congratulate the user for winning. if the guess is incorrect, let the user know if the guess is too high or too low. • after 5 incorrect guesses, tell the user the right answer.

the following is an example of correct input and output.

i'm thinking of a number in the range 0-50. you have five tries to guess it.

guess 1? 32

32 is too high

guess 2? 18

18 is too low

guess 3? 24

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 03:00, tay9122
Jason, samantha, ravi, sheila, and ankit are preparing for an upcoming marathon. each day of the week, they run a certain number of miles and write them into a notebook. at the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day. write a program to them analyze their data. your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. furthermore, your program must contain at least the following functions: a function to read and store the runners’ names and the numbers of miles run each day; a function to find the total miles run by each runner and the average number of miles run each day; and a function to output the results. (you may assume that the input data is stored in a file and each line of data is in the following form: runnername milesday1 milesday2 milesday3 milesday4 milesday5 milesday6 milesday7.)
Answers: 3
image
Computers and Technology, 23.06.2019 10:00, austintules2005
Whats three fourths of 15(this is supposed to be in math but i clicked too fast)
Answers: 1
image
Computers and Technology, 23.06.2019 14:00, shawn423
How are stop motion special effects in animated films created
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, MagicDragon4734
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
Do you know the correct answer?
Define a function called guessnumber that implements the following game, in which the computer will:...

Questions in other subjects:

Konu
History, 21.09.2021 01:00