Question: PYTHON 8.16 LAB: Varied amount of input data Statistics are often calculated with varying amounts of input data. Write a program that takes any number
PYTHON
8.16 LAB: Varied amount of input data
Statistics are often calculated with varying amounts of input data. Write 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
Note: For output, round the average to the nearest integer.
Code I have:
''' Type your code here. ''' sum1 = 0 i = 1 boolean = True
while (boolean): list1=input().split() for i in list1: sum1=sum1+int(i) print(sum1//len(list1),end=" ") max1=int(list1[0]) for i in range(1,len(list1)): if(max1 It needs to pass the following tests but im struggling 1: Compare output 0 / 3 Output differs. See highlights below. Input 15 20 0 5 Your output 10 Input 2 2 2 2 12 0 8 4 Your output 4 Input 5 Your output 5 Input 0 Your output 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
