Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Function basics
4. Calling your function


Great! You've created your first function. In order to use your function, you have to call it:

def hello_world():
  print('Hello, World!')


This way, the function actually prints the Hello, World! sentence. Observe that the function call hello_world() is not indented. It is at the same indentation level as the def keyword. This way Python knows that the function definition is over and what follows is regular code.


Create a function named motivate() that prints the following sentence:

You can do this!

Then, call it in order to print the sentence.