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
Get step-by-step solutions from verified subject matter experts
