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
tangare [24]
3 years ago
14

python 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.
Computers and Technology
1 answer:
Veronika [31]3 years ago
8 0

Answer:

The following are the program in the Python Programming Language.

#get input from the user

val = input("Enter the value: ")

#split the input values

x=val.split()

#declare and initialize two variables to 0

total, l = 0,0

#set for loop

for n in x:

 #coverting into string

 n = int(n)

 #perform addition

 total= total + n

 #check that is l is none or n is greater than l

 if(l is None or n > l):

   #initialize the value of n in l

   l = n

#print the following output

print("Average and maximum value are:", total // len(x), l)

<u>Output</u>:

Enter the value: 10 20 0 5

Average and maximum value are: 8 20

Explanation:

<u>Following are the description of the program</u>.

  • Firstly, declare a variable 'val' in which we get string type input from the user.
  • Again declare two variables and assigned them to 0.
  • Then set the for loop statement, in which we convert the string variable into the integer and perform addition with those converted values. Set the if conditional statement to check that if the variable 'l' is none or 'n' is greater than 'l ' then, assigned the value of the variable 'n' in the variable 'l'.
  • Finally, print the following result with message.
You might be interested in
What is the basic purpose of Google calendar?
goldenfox [79]
The basic purpose of a google calendar is basically the same as a regular calendar. it is used to keep track life's important events all in one place.    
7 0
3 years ago
Read 2 more answers
The chart shows changes in sea level from 1995 to 2013. According to the chart, sea levels rose at an average annual rate of 3.2
MariettaO [177]

Answer:

Did the global surface temperature increase steadily from 1995 to 2013?

Did sea ice extent in polar regions reduce because of melting from 1995 to 2013?

Explanation:

Only two questions are directly related to global warnings increasing sea levels:

  • Did the global surface temperature increase steadily from 1995 to 2013? Increasing temperature of the Earth's surface is actually what warming means.
  • Did sea ice extent in polar regions reduce because of melting from 1995 to 2013? If the polar ice melts then the sea levels will rise.

The other three questions were about the negative effects of rising sea levels, but not what could cause them.

5 0
3 years ago
Read 2 more answers
A family member who hasn’t worked with computers before has decided to change jobs. You’ve been asked to explain some of the bas
Olin [163]

Answer: That due to the specific tasks that needs to be accomplished by each program to make an all encompassing program would be inefficient and full  of bugs

Explanation: try to do something along those lines ex why would MySQL be used to check your essay for grammar  the tasks are on opposite spectrums

8 0
2 years ago
"giga" can mean both 109 and 230. explain to what each refers. can this cause confusion when reading a computer advertisement?
inn [45]
Giga usually means 10^9

We're trying to work giba, which is 2^30 into the vocabulary to differentiate them because of the confusion and difference that they create.
7 0
3 years ago
What is a collection of computing resources that are elastic and highly virtualized?
In-s [12.5K]

Answer:

private cloud

Explanation:

I just know

5 0
2 years ago
Other questions:
  • A smart refrigerator can use _____ to detect when you are running low on milk, and then send a reminder to you on a wireless net
    14·1 answer
  • How do keystroke dynamics determine whether to authenticate an individual or not?
    14·1 answer
  • What operating system is an open source program
    15·1 answer
  • Which of the following are benefits of designing a scalable system? Choose 3 options.
    15·1 answer
  • Different network devices function at different network communication layers, depending on their purpose. Using the TCP/IP model
    5·1 answer
  • So I was looking at my profile and it says i'm a brainly PLUS member didn't sign up for it tho. Any ideas why this could have ha
    14·2 answers
  • What should you include in a persuasive speech
    14·1 answer
  • What are some of the ways we can resolve IPv4 address shortages? Check all that apply.
    13·1 answer
  • Design the following webpage using suitable html code .
    11·2 answers
  • Help plz (will give brainliest)
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!