Solved:

Checkmark

Answered by AI, Verified by Human Experts

Write a loop to populate the list user_guesses with a number of guesses. Each guess is an integer. Read integers using int(input()). Sample output with inputs: 3 9 5 2 user_guesses: [9, 5, 2]

Write a loop to populate the list user_guesses with a number of guesses. Each guess is an integer. Read integers using int(input()). Sample output with inputs: 3 9 5 2 user_guesses: [9, 5, 2]

Answer:This is a zybook activity. I am providing code in Python.num_guesses = 3user_guesses = []guess = 0while guess < num_guesses:integers = int(input())user_guesses.append(integers)guess = guess + 1print(user_guesses)Explanation:The num_guesses holds the number of guesses which is 3.user_guesses is a list that is to be populated with the three integers of guesses.guess holds the numbers entered by the user.The while loop keeps on executing until the number of guesses entered by the user exceeds the value given in the num_guesses i.e. 3.The integer numbers entered by the user is read by the int(input()) function which accepts and reads the input from user and int means that the input value should be of type int (integer).user_guesses.append(integers)statement means that the integers entered by the user are added to the user_guesses list. append() method is used to add each single integer in the list.Then the value of guess is incremented by 1 and each number entered by the user is entered into the user_guesses list one by one.After the numbers entered by the user exceeds the limit given in num_guesses which is 3, the loop breaks and theprint(user_guesses)statement is executed which prints the list user_guesses which now contains 3 integer numbers entered by the user.Output:325[3, 2, 5]The program along with output is attached as screenshot....

Unlock full access for 72 hours, watch your grades skyrocket.
For just $0.99 cents, get access to the powerful quizwhiz chrome extension that automatically solves your homework using AI. Subscription renews at $5.99/week.