Python Programming - Functions - Discussion

Discussion Forum : Functions - General Questions (Q.No. 40)
40.
What will be the output of the following code snippet?
def greet(name="User"):
    return f"Hello, {name}!"

message = greet()
print(message)
Hello, User!
Hello, None!
Error
Hello, World!
Answer: Option
Explanation:
The default value for the parameter name is "User," so if no argument is provided, it uses the default.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.