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]
4 years ago
7

3.14 LAB: Simple statistics for Python

Computers and Technology
1 answer:
Ad libitum [116K]4 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
David Rosen is credited with the development of which of these games?
nikklg [1K]
David Rosen is the CEO and lead programmer of Wolfire games. some of their games include Overgrowth, Desperate Gods, and Receiver.
4 0
4 years ago
How to bypas power switch on pc and make it switch on
Andreas93 [3]
If your powersupply has the standard 24 pin connector, you can make it switch on by connecting a green and a black (find a good picture to see the pin numbers). Google for the "paperclip test" for details.
6 0
3 years ago
What is the advantage of breaking your application’s code into several small procedures?
Sholpan [36]

Answer: For better code management and modularity

Explanation:

An application consist several lines of code so when we break an entire code into several small procedures it becomes easy to maintain and look for errors while debugging. This process also is part of good code writing and hence easy to manage our code during testing and debugging phases of application development.

3 0
3 years ago
Please add thenodes given below to construct the AVL tree show all the necessarysteps,
Paha777 [63]

Answer:

30,33,37,18,23,34,15,38,40,17

To construct the AVL tree, follow these steps and diagrams are shown in the image:

• Add 30 to the tree as the root node. Then add 33 as the right child because of 33 is greater than 30 and AVL tree is a binary search tree.

• Then add 37 as the right child of 33. Here the balance factor of node 30 becomes 0-2 = -2, unbalanced.

Use RR rotation, make node 33 the root node, 30 as the left child of 33 and 37 as the right child of 33.

• Now add 18 as the left child of 30. And 23 as the right child of 18. Here the balance factor of 30 becomes 2-0 = 2. It’s unbalanced.

Use LR rotation, make 23 the parent of 18 and 30.  

• Now add 34 as the left child of 37 and 15 as the left child of 18. Add 38 as the right child of 37. And then add 40 as the right child of 38.

• Now adding 17 as the right child of 15 makes the tree unbalanced at 18.

Use LR rotation, make 17 as the parent of 15 and 18.

Explanation:

The balance factor of a node can be either 0,1 or -1. Else the tree is called unbalanced at the node.

If the inserted node is in the left subtree of the left subtree of the unbalance node, then perform LL rotation.

If the inserted node is in the right subtree of the right subtree of the unbalance node, then perform RR rotation.

If the inserted node is in the left subtree of the right subtree of the unbalance node, then perform RL rotation.

If the inserted node is in the right subtree of the left subtree of the unbalance node, then perform LR rotation.

7 0
3 years ago
What is the output?
Aleksandr-060686 [28]

Answer:

The output of code is 20.

Explanation:

We need to give output of the following code:

numB = 25

while numB > 13:

numB = numB - 5

print(numB)

Solution:

We will check the condition of while loop, if the condition is true, then the statements inside the loop will be executed. Since brackets are not available so, only one statement is linked with while loop.

Executing the statements, we check condition while numB > 13 (25>13) is true, next statement will be executed numB = numB - 5  (20=25-13) so, when print(numB) will be executed, we will get 20.

The output of code is 20.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Type the correct answer in the box. Spell all words correctly. What type of network is the Internet? The Internet is an example
    13·1 answer
  • Is virtualization self monitoring
    6·1 answer
  • Should a waiting thread receive priority over a thread first attempting to enter a monitor? What priority scheme, if any, should
    9·1 answer
  • "what is the problem with using challenge handshake authentication protocol (chap) as an authentication protocol?"
    13·1 answer
  • Is it safe to turn on a computer without ram?
    5·2 answers
  • Usted repetir la pregunta?<br>O A. Es<br>B. Puede<br>C. Puedes<br>O D. Está​
    8·2 answers
  • Sean Cody is a website most known for what?
    9·2 answers
  • What does good time management mean​
    8·2 answers
  • Create a static method that: - is called appendPosSum - returns an ArrayList - takes one parameter: an ArrayList of Integers Thi
    6·1 answer
  • What is the name of the arm that is attached to the read/write head?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!