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
Anyone have any website ideas I could use for my computing website project? Thank you.
nlexa [21]
Yes like keynote yup keynote I use a lot of PowerPoints on keynote Yk
8 0
2 years ago
Read 2 more answers
Gmod how to make someone admin on a lan server
andrezito [222]
In case you're playing on a local multiplayer server

There is no such thing as admin on a normal local server. You're able to do everything.

In case you're playing on a dedicated server

<span>In the server command prompt, make a RCON command which states: ulx adduser <your user name> superadmin. This will add you as superadmin, using the </span><span>ULX admin addon.</span>
4 0
3 years ago
Read 2 more answers
andy accidentally saved a file in the wrong folder. what is the quickest way to move the file? create a new file and save it in
Kruka [31]

take the improper folder to the proper place. but if that don't work if you have a copy of it then copy paste it to always be sure to have a backup

and sans said have this picture∵

                                                -

8 0
3 years ago
Read 2 more answers
Which of the following formats can algorithms NOT be written in:
umka2103 [35]
Hello there.

Which of the following formats can algorithms NOT be written in:

Answers: Flow Chart 
5 0
2 years ago
Read 2 more answers
Identify the correct sequence of steps to change the font from Verdana to Arial.
kotegsom [21]
Click the font button in the top left hand corner, and search fkr verdana.
3 0
3 years ago
Other questions:
  • Your friend Kayla is starting her own business and asks you whether she should set it up as a P2P network or as a client-server
    13·1 answer
  • Write a method so that the main() code below can be replaced by the simpler code that calls method mphandminutestomiles(). origi
    14·2 answers
  • I want to know all part of computer system?
    9·2 answers
  • This morning when Paul turned on his computer at work, it would not boot. Instead, Paul reported that he heard a loud clicking n
    6·1 answer
  • ______ are used to store all the data in a database.
    7·1 answer
  • What is the importance of effectiveness in communication?
    14·1 answer
  • _________ can be used to provide access control, confidentiality, data origin authentication, connectionless integrity, rejectio
    12·1 answer
  • What time is it NOW??
    11·2 answers
  • Caps lock key is used to type alphabets. _________​
    6·2 answers
  • Marcus creates a HTML webpage on his favourite game, football. On clicking the word “football” another website containing the in
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!