Python – Functions

You can declare a function when you reuse the same blocks of code in one script.

A function is a block of code which only runs when it is called.

You can pass data, known as parameters, into a function.

A function can return data as a result.

In Python a function is defined using def

def cheese():
  print("I love cheese!")