Write a loop to populate the list user_guesses with a number of guesses. The variable num_guesses is the number of guesses the user will have, which is read first as an integer. Read each guess (an integer) one at a time using int(input()). Sample output with input: 3 3952 user_guesses: [9, 5, 2]

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 8PE
icon
Related questions
Question

I need help creating a phython program on lists method

CHALLENGE
ACTIVITY
10.3.1: Get user guesses.
Write a loop to populate the list user_guesses with a number of guesses. The variable num_guesses is the number of guesses the
user will have, which is read first as an integer. Read each guess (an integer) one at a time using int(input()).
Sample output with input:
3
9
5
2
user_guesses: [9, 5, 2]
428668.2827818.qx3zqy7
1 num_guesses = int(input())
2 user_guesses = []
3
4 Your solution goes here ***
5
6 print('user_guesses:', user_guesses)
1 test
passed
All tests
passed
Transcribed Image Text:CHALLENGE ACTIVITY 10.3.1: Get user guesses. Write a loop to populate the list user_guesses with a number of guesses. The variable num_guesses is the number of guesses the user will have, which is read first as an integer. Read each guess (an integer) one at a time using int(input()). Sample output with input: 3 9 5 2 user_guesses: [9, 5, 2] 428668.2827818.qx3zqy7 1 num_guesses = int(input()) 2 user_guesses = [] 3 4 Your solution goes here *** 5 6 print('user_guesses:', user_guesses) 1 test passed All tests passed
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Basics of loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT