R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the output?

Code:
def calc(a, b):
return a + b

print(calc(2.5, 3))
  • (A) 5.5
  • (B) 6
  • (C) 5
  • (D) Error
  • Correct Answer - Option(A)
  • Views: 11
  • Filed under category Python
  • Hashtags:

Explanation by: Ram Sharma
2.5 + 3 = 5.5; Python handles mixed-type arithmetic.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.