Functions
Functions
Python Functions
def get_final_answer(filename):
“““Documentation String”””
line1
line2 Colon.
return total_counter
• This defines the function but does not execute the body of the
function
def print_lyrics():
print("I'm a lumberjack, and I'm
okay.")
print('I sleep all night and I
work all day.')
Default Values for Arguments
• You can provide default values for a
function’s arguments
• These arguments are optional when the
function is called