Function and Modules (Cheat Sheet)

Example

Functions need to be declared in the file before they can be used

def my_function():
   print("I")
   print("am")
   print("a")
  print("function")

my_function()

Parameter and variables declared in a function are local to the function

Returning values

def min(alb):
   if a < b :
      return a
   else:
      return b

print min(5,8)