Question: I am having issues with the print code line, nothing I try works. Can someone help? SCENARIO: Statistics are often calculated with varying amounts of

I am having issues with the print code line, nothing I try works. Can someone help?

SCENARIO:

Statistics are often calculated with varying amounts of input data. Have a program that takes any number of integers as input, and outputs the average and max.

Ex: If the input is:

15 20 0 5 

the output is:

10 20 

MY CODE:

val = input("Enter the value: ") val_list = val.split() val_list = [int(x) for x in val_list] total = 0 max_val = -9999999 for val in val_list: total = total + val if val > max_val: max_val = val average = total / len(val_list) 

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 Programming Questions!