A function declaration defines a named, reusable operation. Treat it as a promise: provide the expected inputs, and the function returns the appropriate output without requiring you to know its internal mechanics. section 3.1.1
In Python, the declaration begins with a function header. The header uses def, gives the function a name, lists its inputs, and ends with a colon. The body contains the work and return statements can provide the result. section 3.1.1
# write a function that returns the larger of two numbers
# input is two numbers
# output is the larger of the two numbers
def larger(num1, num2): #1
if num1 > num2: #2
return num1 #2
else: #2
return num2 #2
This example declares larger, compares two numbers, and returns the larger value. Comments can describe the desired inputs and output before code generation. section 3.1.1





