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
in a stop-and-wait arq system, the bandwidth of the line is 1 mbps, and 1 bit takes 10 ms to make a round trip. if the system da
MArishka [77]

Answer:

٢٣٤

Explanation:

5 0
2 years ago
The function of anOR gate can best be described as a gate which provides an output of 1 only when
amid [387]

Answer:

Following are the program to this question:

#include <iostream>//defining header file

using namespace std;

void OR_gate()//defining a method OR_gate

{

bool a,b;//defining bool vaiable

cin>>a>>b;//input value

if(a or b)//use if block to check condition

{

cout<<"1";//print message

}

}

int main()//defining main method

{

OR_gate();//calling method OR_gate  

return 0;

}

Output:

0

1

1

Explanation:

In the above program, a method "OR_gate" is declared, and inside the method two bool variable "a and b" is defined, which input the value from the user end.

In the next step, an if block is defined, that uses the or gate to check input value and print the value that is equal to 1, and inside the main method, it call the "OR_gate" method.

5 0
2 years ago
Consider the following recurrence, defined for n a power of 4 (for the time of some algorithm): T(n) = 3 if n = 1 2T(n/4) + 4n +
In-s [12.5K]

Answer:

Explanation: see attachment below

4 0
3 years ago
Fred opens a web browser and connects to the www.certskills.com website. Which of the following are typically true about what ha
Masja [62]

Answer:

c. Messages flowing to the client typically use a source TCP port number of 80.

d. Messages flowing to the server typically use TCP.

Explanation:

When fred open the web browser and start a connection to the www.certskills.com website.Two things happens from the mentioned things

1.Messages that are going to the server are use TCP(Transmission Control Protocol).

2.Message goes to the client uses port number 80 that is of TCP used for transferring web pages.

Because the port number 80 is reserved for the HTTP used for transferring web pages that uses TCP protocol.

4 0
3 years ago
Na2CO3 → Na2O + what
Katarina [22]

Answer:

CO3

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • EXPLAINING A URL
    15·1 answer
  • In what decade did the Internet begin to be used widely by the public and not just government entities?
    5·2 answers
  • Using social media and sending a blast are examples of
    13·1 answer
  • What would be one advantage and one risk of using an electric car?
    14·2 answers
  • The first computer (the eniac was how big
    8·1 answer
  • darren wants to substitute every occurence of the word bulky in his spreadsheet with the word strong. which of these options sho
    9·2 answers
  • Has anyone on here heard from lilkoadkmillines?
    10·1 answer
  • Explain how to utilize the computer in rooms management.​
    13·1 answer
  • Describe the uses of computer in different fileds? please help me ​
    14·1 answer
  • About C header files of C programming
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!