How do we actually make a function? In Python, a function can be defined using the def keyword in the following format:
svg viewer
The function name is simply the name we’ll use to identify the function.
The parameters of a function are the inputs for that function. We can use these inputs within the function. Parameters are optional.
The body of the function contains the set of operations that the function will perform. This is always indented to the right.
Implementation
Let’s start by making a plain function that prints four lines of text. It won’t have any parameters. We’ll name it my_print_function. We can call the function in our code using its name along with empty parentheses: