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
Taya2010 [7]
3 years ago
15

You are to create a program using Python that asks the user for a nonnegative number, then computes the mean and variance using

the above given online update formulas which should be displayed on the console screen. The program should end when a user enters a negative number.
Computers and Technology
1 answer:
Alik [6]3 years ago
7 0

Answer:

# In the new version of python is available the functions mean() an variance()

# In the module of statistics

i = 0 #Var to input the elements

l = [] #Var to store the elements on a list

while(i>0):

    print("In put a positive number to add in the list or negative to exit ")

    i = input()

    l.append(i)

    print("The mean of the all elements is: " + mean(l) )

    print("The variance of the all elements is: " + variance(i) )

Explanation:

At present, you can use in the <em>news python's verison</em> e.g. (python 3.7) the <em>statistics module</em> and use functions like <em>mean(), variance(), stdev()</em> and many others.

In the first step you create two variables, i to recieve the inputs of a loop and l to store all the elements recieved in the<em> i</em> variable. after that you pass as an argument the list that you stored before and get the <em>mean()</em> and <em>variance()</em> of the all elements in the list.

I hope it's help you.

You might be interested in
Containers for contaminated sharps must have several characteristics. What’s missing from the list? PuContainers for contaminate
Nadya [2.5K]
All sharps containers must be stored upright,be puncture-resistant, be labeled or color-coded red & leakproof on both the sides & the bottom! The last one is the one missing!
4 0
2 years ago
Read 2 more answers
Typically, a programmer develops a programâs logic, writes the code, and ____ the program, receiving a list of syntax errors.
miv72 [106K]
"debugs" is the answer
4 0
3 years ago
Care should be taken whenever you post comments or photos to any social media or other websites, because each of these online ac
ohaa [14]

Answer:

True is the correct answer for the above question.

Explanation:

  • The social website is used to connect the people using the internet to communicate. With the help of this, any people can communicate within the world's people.
  • If anyone posts their pictures or comment on this type of website, then they need to care for that post or pictures. it means he needs to make decisions to choose the pictures or comments while posting.
  • It is because when the user posts the wrong comments or pictures, then their popularity is less in front of the other people called society.
  • This concept is also said by the question, hence it is a true statement.
5 0
3 years ago
A hacker using information gathered from sniffing network traffic uses your banking credentials from a recent transaction to cre
adell [148]

Answer: a replay attack, a replay attack is used so that the attacker can go sniff out the hash, and get whatever they are trying to get, then once it goes to the attacker it will go back to the original connection after replaying the hash

3 0
2 years ago
What is an internal node?
Phantasy [73]
An internal node is a node which carries at least one child or in other words, an internal node is not a leaf node.
8 0
3 years ago
Other questions:
  • A Color class has a method getColorName that returns a string corresponding to the common name for the color, e.g., yellow, blue
    11·1 answer
  • In the INSERT statement that follows, assume that all of the table and column names are spelled correctly, that none of the colu
    9·1 answer
  • Help!!!! ASAP TIMED TEST 50 points!!!!
    7·1 answer
  • Select the education and qualifications that are most helpful for business analysis careers. Check all that apply
    11·2 answers
  • What is data? why is it important to collect data ? explain the points.​
    10·1 answer
  • Does technology shape society or does society shape technology?
    14·1 answer
  • If you notice that a worksheet displays columns A, B, C, E, and F, what happened to column D?
    9·1 answer
  • Will economists be replaced by artificial intelligence?
    12·1 answer
  • Which of the following is opened when the Find command is clicked? Question 9 options: Navigation Pane Insert Hyperlink dialog b
    10·1 answer
  • Difference between sorting and filtering​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!