1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
storchak [24]
3 years ago
15

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.
Computers and Technology
1 answer:
katen-ka-za [31]3 years ago
4 0

Answer:

txt = input("Enter numbers: ")

numbers = txt.split(" ")

total = 0

max = 0

for i in numbers:

     total = total + int(i)

     if(int(i)>max):

           max = int(i)

print(round(total/len(numbers)))

print(max)

Explanation:

This solution is implemented using Python programming language

This prompts user for input

txt = input("Enter numbers: ")

This splits user input into list

numbers = txt.split(" ")

The next two line initialize total and max to 0, respectively

total = 0

max = 0

This iterates through the list

for i in numbers:

This sum up the items in the list (i.e. user inputs)

     total = total + int(i)

This checks for the maximum

     if(int(i)>max):

           max = int(i)

This calculates and prints the average

print(round(total/len(numbers)))

This prints the max

print(max)

You might be interested in
What term describes an instance of a program being executed?
ale4655 [162]
The term would process. A process is an instance of a program being executed.
6 0
3 years ago
The first window displayed when you install opensuse is the ____ window.
Jlenok [28]
Is the <span>Boot Options window.</span>
3 0
3 years ago
Codehs python 4.7.6 Powers of Two <br> it says I'm wrong because I need
Finger [1]

Following are the program to calculate the power of two:

Program Explanation:

  • Defining an integer variable "i" that hold an integer value.
  • Defining a for loop that checks "i" value in between 20, inside this it calculates power of two.
  • At the last use print method to print its value.

Program:

i=1#holding integer value in i

for i in range(20):#defining a for that starts 1 to 20    

   i = 2 ** i#calculate power of 2 in i variable

   print(i)#print value

Output:

Please find the attached file.  

Learn more:

brainly.com/question/23170807

8 0
3 years ago
Read 2 more answers
Your digital footprint says a lot about you, but not everything is true or accurate. When you're a high school or college studen
Aleks [24]

Answer:

yes

Explanation:

cuz im yearz old

7 0
3 years ago
Suppose testcircle1 and circle1 in listing 9.1 are in two separate files named testcircle1.java and circle1.java, respectively.
zlopas [31]
What is "listing 9.1"?

Stop copying and pasting, or provide us with the resources to answer your question.
8 0
3 years ago
Other questions:
  • What does microsoft recommend for large organizations requiring desktop virtualization for many clients? quizlewt?
    10·1 answer
  • You support Richman Investments, a brokerage firm that employs 20 brokers. Each broker has his own client computer, and the firm
    15·1 answer
  • Rachel wants to post content from digital cameras on the web. Which online tool will help Rachel to post and edit content on a w
    5·1 answer
  • SOMEONE HELP PLEASE!!!!!
    6·1 answer
  • Describe how computer become <br> in the next 35 year
    5·1 answer
  • URGENT!!! Steve wants to change shooting and exposure settings while on his photo shoot. Which camera part will allow him to do
    12·2 answers
  • Refer to the exhibit. A network security analyst is using the Follow TCP Stream feature in Wireshark to rebuild the TCP transact
    8·1 answer
  • Indicate whether the following statements are true or false:
    14·2 answers
  • State whether the following statement are true or false​
    6·1 answer
  • What Is The First Computer Brought In Nepal ? <br>​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!