Question: Problem 2 Functions. Read the code below and answer the following five questions about the code. Notice that the question marks should be substituted with

 Problem 2 Functions. Read the code below and answer the following
five questions about the code. Notice that the question marks should be
substituted with variables or values. You need to find what value or
variable should be used for each question mark. def add (a, b):
return a + b def subtract(a, b): return a b X, y
= 10, ? Z = add(x, y) print(2) z += subtract(?, ?)

Problem 2 Functions. Read the code below and answer the following five questions about the code. Notice that the question marks should be substituted with variables or values. You need to find what value or variable should be used for each question mark. def add (a, b): return a + b def subtract(a, b): return a b X, y = 10, ? Z = add(x, y) print(2) z += subtract(?, ?) print(2) D Question 6 2 pts If the program output is: 22 24 what is the second argument of the function subtract? none Oy Oz Question 7 2 pts If the program output is: 22 24 what is the final value of the variable z? Oy O 22 O2 24 O -2 Question 8 2 pts If the program output is: 22 24 what is the first argument of the function subtract? N none y 2nts D Question 9 Question 9 2 pts If the program output is: 22 24 what is the value of the variable y? Oy O 14 O 12 O 10 none Question 10 2 pts If the program output is: 22 24 what is the first value of the variable z (printed to the stdout)? O none OY O -2 O N O 24 22

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!