Editor

Say Hello

Strings · Beginner · 25 XP · about 2 min

Write a function called say_hello(name) that takes a person's name and returns a greeting string.

Example

say_hello("Alice")   # Returns "Hello, Alice!"
say_hello("Bob")     # Returns "Hello, Bob!"
say_hello("World")   # Returns "Hello, World!"

Requirements

  • Return the greeting in the format: "Hello, {name}!"
  • Include the comma after "Hello" and exclamation mark at the end
def say_hello(name):
# Your code here
pass
# Test your function
print(say_hello("Alice"))
print(say_hello("Bob"))

Ready?

Accept the challenge to start writing. A small timer counts the time this page is in view.

Output appears here.