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
trapecia [35]
3 years ago
7

3.14 LAB: Simple statistics for Python

Computers and Technology
1 answer:
Ad libitum [116K]3 years ago
8 0

Answer:

Following are the correct python code to this question:

n1 = float(input('Input first number: '))#input first number  

n2 = float(input('Input second number: '))#input second number  

n3 = float(input('Input third number: '))#input third number  

n4 = float(input('Input fourth number: '))#input fourth number  

average = (n1+n2+n3+n4)/4 #calculate input number average

product = n1*n2*n3*n4 # calculate input number product

print('product: {:.0f}  average: {:.0f}'.format(round(product),round(average))) #print product and average using round function

print('product: {:.3f}  average: {:.3f}'.format(product,average)) #print product and average value

Output:

Please find the attachment.

Explanation:

The description of the above python code can be defined as follows:

  • In the above python program four variable "n1, n2, n3, and n4" is defined, in which we take input from the user end, and in these user inputs we use the float method, that converts all the input value in to float value.
  • In the next step, two variable average and product are defined, that calculate all input numbers product, average, and hold value in its variable.
  • In the last line, the print method is used, which prints its variable value by using a round and format method.

You might be interested in
After the following code runs, what will be the value of result? var x = 30; function get () { return x; } function set (value)
PilotLPTM [1.2K]

Answer:

Null

Explanation:

It entirely depends on the language you are using to implement this.

But generally by the rule of scope, "result" will return null since get() was not defined to accept any argument, and it neither know the global "x" not defined it's own x in the function.

5 0
3 years ago
Which of the following is a command shell with a built-in scripting language?1. The Server Manager’s Roles and Features wizard2.
IgorLugansk [536]
Your kinda right but wrong
4 0
3 years ago
Read 2 more answers
Write a program using integers userNum and x as input, and output userNum divided by x four times. Ex: If the input is: 2000 2
STatiana [176]

Answer:

// here is code in c++.

// include header

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variables to read input

   int userNum,x;

   cout<<"enter the value of userNum and x :";

   // read the input from user

   cin>>userNum>>x;

   // divide the userNum with x 4 times

   for(int a=0;a<4;a++)

   {

       userNum=userNum/x;

       cout<<userNum<<" ";

   }

       cout<<endl;

return 0;

}

Explanation:

Declare two variables "userNum" and "x". Read the value of these. Run a for loop 4 time and divide the "userNum" with "x" and print  the value of "userNum".

<u>Output:</u>

enter the value of userNum and x :2000 2                                                                                  

1000 500 250 125  

3 0
2 years ago
Explain why regular system cleanup is vital to ensuring the operating system runs efficiently.
Oksanka [162]
Cleaning up a system helps clear up the space on the drives. It may also clear up processor usage, ram usage if you uninstall programs that automatically started when the system booted. You may also delete some unwanted programs in the process.
5 0
3 years ago
In what domain electrica energy is the most use
amm1812

Answer:the main signal bearing entities are voltage and their current in circuit environments.

Explanation:

5 0
2 years ago
Other questions:
  • With respect to the general classes of computers, a ________ is the most expensive and most powerful kind of computer, which is
    7·1 answer
  • You are an inventor. You are taking out an ad in a newspaper because you want people to buy/use your product/invention. Include
    9·1 answer
  • All users on the network have antivirus software; however, several users report that they have what an administrator described a
    10·1 answer
  • Write a program that uses these bounds and bisection search (for more info check out the Wikipedia page on bisection search) to
    8·1 answer
  • Select the correct answer
    11·2 answers
  • What are the two most popular applications of theInternet?
    7·1 answer
  • Describe how catching exceptions can help with file errors. Write three Python examples that actually generate file errors on yo
    12·1 answer
  • graham drove 39 2/3 miles in 1 1/3 hours. What is the unit rate for miles per hour? Use a pencile and paper. Describe a situatio
    10·1 answer
  • if anyone is on a Chromebook, do you ever mean to press backspace, then you accidentally press the power button and think "OH CR
    13·2 answers
  • SmartArt is a Microsoft Office tool for creating what?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!