CBSE Class 12 Computer Science Question 36 of 103

Working with Functions — Question 12

Back to all questions
12
Question

Question 12

For a function header as follows :
def Calc(X,Y = 20):
Which of the following function calls will give an error ?

  1. Calc(15, 25)
  2. Calc(X = 15, Y = 25)
  3. Calc(Y = 25)
  4. Calc(X = 25)
Answer

Calc(Y = 25)

Reason — The function call statement must match the number and order of arguments as defined in the function definition. Here, the X positional argument is missing.