Lesson 6.0
You can create your own command — a function:
def hello():
print("Hello!")
print("How are you?")
hello()
There are two parts here:
def with a name, brackets and a colon, and an indented body;hello().A definition on its own prints nothing: the code inside runs only when you call it, and you can call it as many times as you like.
Write a function hello() that prints Hello! and then How are you?, and call it
exactly twice.
A function is def with a name, brackets and a colon.
The body is indented and holds the print. A call is the name with brackets, otherwise
the function never runs.