Question: The following program is supposed to allow the user to enter a list of numbers, then print them out formatted with 2 decimal positions.

The following program is supposed to allow the user to enter a list of numbers, then print them out formatted with 2 decimal positions. However, there are 3 errors. Indicate the line number of each error and what you would change to fix each one. 123456789DUZENEA 10 11 1 def display_nums (nums): for num in nums: print (f'(num: 0.2d}') def read input(): input_str = input('Enter a list of numbers: ') nums = [] for s_num in input_str.split(): nums.append(float(s_num)) return nums def main(): nums = read_input display_nums (nums)
Step by Step Solution
There are 3 Steps involved in it
Answer Here is the corrected version of the entire program def displaynumsnums ... View full answer
Get step-by-step solutions from verified subject matter experts
