What is the output of the following Python code snippet?
def greet(name='Guest'):
return f'Hello, {name}'
print(greet())
return f'Hello, {name}'
print(greet())
Correct answer
A. Hello, Guest
5 views
A. Hello, Guest
5 views
A default parameter value is used when no argument is supplied.
Asked in: Python Interview Functions
https://docs.python.org/3/tutorial/controlflow.html#defining-functionsNot sure why the answer is A? Ask here and get an explanation.