25 XP

9. Say hello

Beginner input strings

Your program reads one line: a person's name. Print the greeting Hello, <name>!, with the name in place of <name>: the word Hello, a comma, a space, the name, then !.

Remove any spaces before and after the name first. Spaces inside the name stay, and so does every letter, including letters such as ë or é.

Example 1

InputAda
OutputHello, Ada!
ExplanationThe name goes between "Hello, " and "!".

Example 2

Input Grace
OutputHello, Grace!
ExplanationThe spaces before the name are removed.

Example 3

InputAda Lovelace
OutputHello, Ada Lovelace!
ExplanationThe space inside the name stays.

Constraints

  • The name has 1 to 50 characters, not counting the spaces around it.
  • It can hold letters from any language, and spaces.
  • Print nothing else. A prompt inside input() is fine: the tests leave it out of the output.

Submit also runs 3 more tests you can't see.

Practises String Formatting Deep Dive (lesson 24).

Code
# Read a name and print "Hello, <name>!".
# Remove the spaces around the name first.
name = input()