# In here im giving examples on how the def function works in python.
# Each example is separated by ===
def functionName():
# What to make the function do
==================================================================
def myfunction():
print("Hello World")
myfunction()
==================================================================
def subtractNum():
print(34 - 4)
subtractNum()
# Output: 30
==================================================================
def functionName(arg1, arg2):
# What to do with function
functionName(valueForArg1, valueForArg2)
==================================================================
def addNum(num1, num2):
print(num1 + num2)
addNum(2, 4)
# Output: 6
==================================================================
def multiplyNum(num1):
return num1 * 8
result = multiplyNum(8)
print(result)
# Output: 64
==================================================================