A

Admin • 825.56K Points
Coach

Q. What will be the output of the following Python code?

Code:
def function1(var1,var2=5):
var1=2
var3=var1*var2
return var3
var1=3
print(function1(var1,var2))
  • (A) 10
  • (B) 15
  • (C) Error as var2 is not defined while calling the function
  • (D) Does not give any error as var2 is a default argument
  • Correct Answer - Option(C)
  • Views: 6
  • Filed under category Python
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.