Refer to the following program: a. How many parameters are passed to the functio
ID: 3719898 • Letter: R
Question
Refer to the following program:
a. How many parameters are passed to the function?
b. What are the values of the parameters?
c. What is the value of x within the function?
d. What is the value of y within the function?
e. What is the output of the program?
def sumDiff(x,y):
sum = x + y
diff = x - y
return sum, diff
s, d = sumDiff(4,5)
print( "The sum is", s, "and the difference is" d)
Explanation / Answer
a. How many parameters are passed to the function? > 2 b. What are the values of the parameters? > 4 and 5 c. What is the value of x within the function? > 4 d. What is the value of y within the function? > 5 e. What is the output of the program? > The sum is 9 and the difference is -1
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.