Implementing and calling a greeting function

Report a typo

Suppose you are creating a simple Python application that greets the user. You decided to encapsulate the greeting function in a separate Python script as it is used across the application. Fill in the blanks in the code to import and call the greeting function correctly from another Python script.

Fill in the gaps with the relevant elements
# greeter.py
 greet(name):
     f"Hello, {name}!"

# main.py
 greeter
print(greeter.greet("World"))
defimportreturn
___

Create a free account to access the full topic