Functions · Beginner · 35 XP · about 3 min
Write a function called greet_person(name, greeting="Hello") that creates a greeting message with an optional greeting word.
greet_person("Alice") # Returns "Hello, Alice!" greet_person("Bob", "Hi") # Returns "Hi, Bob!" greet_person("Eve", "Welcome") # Returns "Welcome, Eve!"
Ready?
Accept the challenge to start writing. A small timer counts the time this page is in view.
Output appears here.