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
Flujograma de nómina ​
balu736 [363]
Explanation there is the rest in comments

7 0
3 years ago
List 2 positive impacts of cybersecurity.
kupik [55]

Answer:

Protection for your business and Increased productivity

Explanation:

This is because it ensures your employees aren't at risk from potential threats and, since there no virus, the computers will work well (not slow down)

7 0
3 years ago
Read 2 more answers
A student sits down at a computer and presses the power button. the computer does not turn on. what is a logical explanation as
ASHA 777 [7]
Since the computer is not working, it is best for the student to test methods that will ensure that there may be complications as to why it is not turning on and why it still off. The most basic step in determining the reason is whether the computer's plug is plugged in the outlet and the student should ensure whether it is plug or unplug.
4 0
3 years ago
What query class will you choose<br> for this query "women are evil"?
nikklg [1K]

Answer:

A) Gibberish or Vague Profane

Explanation:

Hope this helps

7 0
2 years ago
Let's write a simple markdown parser function that will take in a single line of markdown and be translated into the appropriate
Klio2033 [76]

Answer:

Here is the answer in Java with appropriate comments for understanding

Explanation:

import java.util.Scanner;

public class Hash {

public static void main(String[] args) {

System.out.print("Enter a string : ");

Scanner scanner = new Scanner(System. in);

String s = scanner. nextLine();   //read string

int k=s.lastIndexOf('#'),count=0;//find last occurence of # then take the next part

  String s2="",s3="";

  for(int i=0;i<s.length();i++)

  {

      if(s.charAt(i)=='#')

          count++;//count the occurence of # of level of heading h1,h2,h3,....

  }

  for(int j=k+1;j<s.length();j++)

  {

      s2+=s.charAt(j);//take the remainging string after #

  }

// System.out.println(k);

 

//System.out.println(count);

if(count<=6)//if it is valid heading

{

  s3="<h"+count+">"+s2+"</h"+count+">";

  System.out.println(s3);  

}

else

  System.out.println("Invalid header");

 

}

}

6 0
3 years ago
Other questions:
  • What happens when a Boolean expression is evaluated?
    7·1 answer
  • What tab contains the copy and paste buttons
    6·2 answers
  • When you declare a string data type, you are actually creating an object from the?
    5·1 answer
  • Grace Hopper led the development of ______, a programming language for business applications.
    6·2 answers
  • Direct Mapped Cache. Memory is byte addressable. Fill in the missing fields based upon the properties of a direct-mapped cache.
    6·1 answer
  • True/False? In association rule learning, the following two rules will always have the same support value.
    9·1 answer
  • 4. What is the formula for calculating the file size?
    11·1 answer
  • This is a glitch ? 


 










































    14·1 answer
  • What should you consider when using a wireless keyboard with your home computer
    15·1 answer
  • When a support agent does not know the answer to a question, a good incident management strategy is to tell the user ____.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!