Functions · 9 / 27 Exercise Easy

Function greeting and farewell

Objective

Create a Python program that defines two functions: one to greet and another to say goodbye. Then, call both functions from the main function of the program.

Instructions

  • Implement a function called greet that displays the greeting Hello on the screen.
  • Implement another function called farewell that doesn't need any parameters and displays the farewell message Goodbye!.
  • Implement a function called main that calls greet and then farewell.
  • Run the program and check the output, which must include both messages.
Output
Hello
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