Discover answers to your questions with Westonci.ca, the leading Q&A platform that connects you with knowledgeable experts. Join our Q&A platform to connect with experts dedicated to providing precise answers to your questions in different areas. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.

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


Sagot :

Answer:

Answered below

Explanation:

#python program

#First get the number of inputs from user

num_inputs = int(input("Enter number of inputs:")

j = 0

sum =0

max = 0

while j < num_inputs:

    num = int(input ("Enter numbers: ")

    sum = sum + num

    if num > max:

        max = num

  j++

#Compute the average   

average = sum/num_inputs

print (average, max)