Skip to content
This repository was archived by the owner on Jun 4, 2019. It is now read-only.

Latest commit

 

History

History
25 lines (23 loc) · 1.19 KB

File metadata and controls

25 lines (23 loc) · 1.19 KB

User Defined Functions

The keyword def introduces a function definition.
It must be followed by the function name and a parenthesized list of formal parameters (if any).
The statements that form the body of the function start at the next line and must be indented.
After a function has been defined, it can be called by typing the function name immediately followed by parentheses that contain the function's arguments (if any).

>>> def the_truth():
...     return True
...
>>> the_truth()
True

Instructions:
Define a function named say_hello() that has no parameters and prints the string "Hello World!" to the console.
Your function should not contain a return statement, only a print statement.
After you have defined the function, call it.