1 # Read input 2 num rows = int(input()) 3 samples_list = [] 4 for i in range(num_rows): 5 samples_list.append([int(x) for x in input().split()]) 6 7 min_list = # Your code goes here 8 9 print (f'All numbers: {samples_list}') 10 print (f'Smallest value in each row: {min_list}')

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

Integer num_rows is read from input, representing the number of rows in a two-dimensional list. List samples_list is a two-dimensional list containing the remaining integers read from input. Assign min_list with the new list containing the smallest value in each row of samples_list.

1 # Read input
2 num rows = int(input())
3 samples_list = []
4 for i in range(num_rows):
5
samples_list.append([int(x) for x in input().split()])
6
7 min_list = # Your code goes here
8
9 print (f'All numbers: {samples_list}')
10 print (f'Smallest value in each row: {min_list}')
Transcribed Image Text:1 # Read input 2 num rows = int(input()) 3 samples_list = [] 4 for i in range(num_rows): 5 samples_list.append([int(x) for x in input().split()]) 6 7 min_list = # Your code goes here 8 9 print (f'All numbers: {samples_list}') 10 print (f'Smallest value in each row: {min_list}')
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

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