Creating a personalized greeting function

Report a typo

You are tasked with creating a simple Python application that welcomes a user. A function should take user's name as input, form a greeting, and return it. After the function is called, the greeting message should be printed. You are provided with a part of the code. Fill the blanks in the code to complete this task.

Fill in the gaps with the relevant elements
def greet_user(name):
    greeting = "Hello, " + name + "!"
     greeting

user_name = ("Enter your name: ")
message = greet_user(user_name)
(message)
printreturninput

Create a free account to access the full topic