easy +5 pts

Hello, name!

Create a personalized greeting function that says hello to anyone.

Write a function named `greet` that takes a single argument `name` (a string) and returns a string that greets the person by name. The returned string must be exactly: `Hello, {name}!` where `{name}` is replaced with the actual name passed in. For example, if the name is `"Alice"`, the function should return `"Hello, Alice!"`. If the name is an empty string, the function should still return `"Hello, !"` (no special handling). Your function should be defined in the starter code and must work for any string input.

Constraints

- `name` will always be a string. - The string length of `name` is between 0 and 100 inclusive. - No other input types are used.

Example

>>> greet("Alice")
'Hello, Alice!'
>>> greet("123")
'Hello, 123!'
>>> greet("")
'Hello, !'
5 points ~5 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Use an f-string to insert the name into the template.
Remember the punctuation: comma, space, and exclamation mark.
The function should return the string, not print it.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.