""" Summarizes the differences between METHODS and FUNCTIONS. Authors: David Mutchler, Yiji Zhang, Mark Hays, Derek Whitley, Vibha Alangar, Matt Boutell, Dave Fisher, Sriram Mohan, Mohammed Noureddine, Amanda Stouder, Curt Clifton, Valerie Galluzzi, their colleagues and PUT_YOUR_NAME_HERE. """ # TODO: 1. PUT YOUR NAME IN THE ABOVE LINE. ############################################################################### ############################################################################### # TODO: 2. READ the explanation below, asking questions # about anything that is not 100% clear to you. # Then mark this _TODO_ as DONE and commit-and-push your work. ############################################################################### ############################################################################### # Methods and functions are the SAME in that: # # 1. They give a NAME to a block of code. # # 2. They are defined by using a DEF statement, e.g.: # # def draw_dragon(color, size): # ... # # 3. They can have PARAMETERS that receive values from actual ARGUMENTS # when the method/function is CALLED. # # Methods and functions are DIFFERENT in that: # # 1. METHODs are associated with instances of CLASSES, # but FUNCTIONS have no such association. # # 2. The notation for calling a FUNCTION is: # function_name(argument1, argument2, ...) # e.g. # foo(3, "green") # # The notation for calling a METHOD is: # object.method_name(argument1, argument2, ...) # # where the object that precedes the DOT must be # an instance of the class with which the method is associated, e.g. # boris.forward(100) # where boris is an instance of the SimpleTurtle class # and forward is a method associated with the SimpleTurtle class. ###############################################################################