how to write a function in python

#to create a function in python, do the following

#create func
def func(): #can add variables inside the brackets
  print("This is the function of the func")
  
# to call a function, do the following
func()

#you would get a line of code saying "This is the function of the func"

Here is what the above code is Doing:
1. We create a function called func.
2. We define what the function does. In this case, it prints a line of text.
3. We call the function.
4. The function runs and prints the text.