R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the return value of the function below?

Code:
def foo():
return

x = foo()
print(x)
  • (A) 0
  • (B) None
  • (C) Empty string
  • (D) Error
  • Correct Answer - Option(B)
  • Views: 25
  • Filed under category Python
  • Hashtags:

Explanation by: Ram Sharma

If a function has no return value or just `return`, it returns `None` by default.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.