Functions · 10 / 27 Exercise Easy

Greet and bid farewell with parameters

Objective

Create a Python program that defines two functions to greet and say goodbye. The exercise is similar to *Function greeting and farewell*, but the greeting function must receive a parameter called name, of text type.

Instructions

  • In the main function, ask the user for a name.
  • Call the greet function passing the name as an argument. It prints the message Hello followed by the name.
  • Then call the farewell function, which prints the message Goodbye!.
  • Run the program and check the output, which must include both messages.
Input
Jonny
Output
Hello Jonny
Goodbye!

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise