''' Purpose: help with understanding that functions are first class ''' def black() : print( "Black" ) def white() : print( "White" ) # we can pass functions as parameters into another function # here, f is the placeholder for the NAME of the function we want to pass in def run( f ) : print( 'f =', f ) f() # if we put parentheses after f, we are saying that we want to run this # parameter, f, as a FUNCTION --> this function doesn't need any parameters # this function run() invokes another function that we are going to pass in # we'll see this happening in a little bit as we go into image manipulations 🦆 # this allows us to run several different functions with each invocation of run() # we can run one function that does several different things by passing in different functions # that can do different things if ( __name__ == "__main__" ) : # run( 5 ) # 5 is an int, it is not a function --> program will blow up # black and white are names of some functions we define above run( black ) run( print ) run( white )