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
cricket20 [7]
3 years ago
13

What will be displayed after the following code is executed? def pass_it(x, y): z = x*y result = get_result(z) return(result) de

f get_result(number): z = number + 2 return(z) num1 = 3 num2 = 4 answer = pass_it(num1, num2) print(answer)
Computers and Technology
1 answer:
Rus_ich [418]3 years ago
7 0

Answer:

The output of the following code is "14".  

Explanation:

In the python program firstly we define a function that is  pass_it() function. In this function, we pass the two variable that is x,y. Then we define two variable z and result in the function. The z variable is used to store the multiplication value of the x,y. In the result variable, we use another function that is get_result() function in this function we pass the value of the z variable as a parameter. This function adds a value that is 2 and returns its value. Then we declare a variable that is num1 and num2. In this variable, we assign value that is 3 and 4 and return value of the pass_it() function in the answer variable and print it.  

You might be interested in
What is the difference between an ISP and a web host?
emmainna [20.7K]

Answer:

An ISP is an internet service provider. AT&T and Comcast are both popular internet service providers. On the other hand, web hosts are used to host websites like att.com. The web host makes the website accessible by other people.

Explanation:

5 0
3 years ago
Which loan type requires you to make loan payments while you’re attending school?
LUCKY_DIMON [66]
The answer is student loans
3 0
3 years ago
Read 2 more answers
What is co-operating process
Greeley [361]

Answer: A process is independent if it cannot affect other process or be affected by it

Explanation:

3 0
3 years ago
Implement a Java program that creates math flashcards for elementary grade students. User will enter his/her name, the type (+,
jeka57 [31]

import java.util.Scanner;

public class JavaApplication44 {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.print("Enter you name: ");

       String name = scan.nextLine();

       System.out.print("Enter your operation (+,-,*,/): ");

       String operator = scan.nextLine();

       System.out.print("Enter the range of the problems: ");

       int ran = scan.nextInt();

       System.out.print("Enter number of problems: ");

       int problems = scan.nextInt();

       int score = 0;

       for (int i = 1; i <= ran; i++){

           int first = (int)(Math.random()*ran);

           int sec = (int)(Math.random()*ran);

           System.out.print("Problem #"+i+": "+first + " "+operator+" "+sec+" = ");

           int ans = scan.nextInt();

           if (operator.equals("+")){

               if (ans == first + sec){

                   System.out.println("Correct!");

                   score++;

               }

               else{

                   System.out.println("Wrong. The correct answer is "+(first+sec));

               }

           }

           else if(operator.equals("-")){

               if (ans == first - sec){

                   System.out.println("Correct");

                   score++;

               }

               else{

                   System.out.println("Wrong. The correct answer is "+(first - sec));

               }

           }

           else if (operator.equals("*")){

               if (ans == first * sec){

                   System.out.println("Correct");

                   score++;

               }

               else{

                   System.out.println("Wrong. The correct answer is "+(first * sec));

               }

           }

           else if (operator.equals("/")){

               if (ans == first / sec){

                   System.out.println("Correct");

                   score++;

               }

               else{

                   System.out.println("Wrong. The correct answer is "+(first / sec));

               }

           }

           

       }

       System.out.println(name+", you answered "+score+" questions correctly.");

   }

   

}

I hope this helps!

8 0
3 years ago
How many feet do you have to stop away from a school bus
mr_godi [17]
You are required by law to stop twenty feet away from a school bus when driving.
7 0
3 years ago
Other questions:
  • This is the main work area of your computer.
    7·1 answer
  • Suppose you own a travel agency in a large city. You have many corporate clients, but growth has slowed somewhat Some long-term
    15·1 answer
  • Indicate whether the following statements are true or false:
    14·2 answers
  • What is an infrastructure dedicated to one organization
    13·1 answer
  • It is a study that aims to gather data to get the particular view,belief, or opion of a group of respondents about a specific is
    9·1 answer
  • Website designers work on the code and programming of a website, not the style or layout of the site.
    9·1 answer
  • In python 3.17 LAB: Convert to dollars
    14·1 answer
  • Have some points part 6<br>anyone know how to change my username?​
    11·2 answers
  • Ok so I’m using a word document and towards the bottom of the page it stops me from moving my text box any further down even tho
    13·2 answers
  • Disadvantages of a grain crusher
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!