Greeting

Easy · rating 900 · strings, implementation

Read a single line containing a name. Print Hello, <name>!

For example, if the input is World, print Hello, World!

Editorial

Greeting is a first-program exercise in reading input and formatting output: read a name and print Hello, <name>!. It's all about string interpolation and getting the punctuation exactly right.

name = input()
print(f'Hello, {name}!')

Complexity

Time: O(n). Space: O(n).

Open Greeting in Code Arena →