Greet the User

Easy ⏱ 8 min 85% acceptance ★★★★★ 4.5
Write a function greet(name) that returns the exact string "Hello, <name>! Welcome.", where <name> is substituted with the given argument. This checks basic string formatting for output, the print-equivalent of a "Hello World" screening question.

Examples

Example 1
Input
greet("Asha")
Output
'Hello, Asha! Welcome.'
Explanation

Direct substitution into the template.

Constraints

  • name is always a non-empty string.

Topics

Input & Outputprint()

Companies

TCSInfosysCognizant

Hints

Hint 1

An f-string handles this cleanly: f"Hello, {name}! Welcome."

Loading the Python runtime… Run executes your code and shows printed output; Submit checks your function against this problem's examples.