R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the output of the following function call?

Code:
def greet(name):
return 'Hello ' + name

print(greet('Alice'))
  • (A) Hello
  • (B) Hello Alice
  • (C) Alice Hello
  • (D) Error
  • Correct Answer - Option(B)
  • Views: 5
  • Filed under category Python
  • Hashtags:

Explanation by: Ram Sharma
The function `greet` returns the string 'Hello ' concatenated with the argument 'Alice'. So, the output is 'Hello Alice'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.