CBSE Class 12 Computer Science Question 44 of 101

Functions — Question 12

Back to all questions
12
Question

Question 12

What will be the output displayed when addEM() is called/executed?

def addEM(x, y, z): 
    return x + y + z 
x=y=z=20
Answer

When the addEM() function is called or executed, there will be no output displayed because there is no print statement.

Explanation

When the function addEM(x, y, z) is called with the values 20 for each of its parameters (x, y, and z), it calculates their sum (20 + 20 + 20), which equals 60. Since the function uses the return keyword to return this calculated sum, calling addEM(20, 20, 20) will return 60.