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 Expected output 10 20 2: Compare output 0 / 3 Output differs. See highlights below.

Input 2 2 2 2 12 0 8 4 Your output 4 Expected output 4 12 3: Compare output 0 / 2 Output differs. See highlights below.

Input 5 Your output 5 Expected output 5 5 4: Compare output 0 / 2 Output differs. See highlights below.

Input 0 Your output 0 Expected output 0 0

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