Question: Write a loop to populate user_guesses with num_guesses integers. Read integers using int(input()). Ex: If num_guesses is 3 and user enters 9 5 2, then

Write a loop to populate user_guesses with num_guesses integers. Read integers using int(input()). Ex: If num_guesses is 3 and user enters 9 5 2, then user_guesses is [9, 5, 2].

my answer (that finally worked) was:

num_guesses = 3 user_guesses = []

guess = 0 while guess < num_guesses: number = int(input()) user_guesses.append(number) guess +=1 print(user_guesses)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!