LearnPy Hub
← Functions problems
Easy

Default Greeting

Write greet(name, greeting="Hello") that returns GREETING, NAME!. Read a name and an optional greeting line; if the second line is -, call greet with the default.

Input

Two lines: name, then greeting or -.

Output

One line.

Sample 1

Input
Mim
-
Output
Hello, Mim!

Sample 2

Input
Rafi
Good morning
Output
Good morning, Rafi!
solution.py
Output appears here
Default Greeting · Python practice problem · LearnPy Hub