def slope( x1, y1, x2, y2) : # the slope of a line can be gotten by examining two points on its # line. # # the slope is the ratio of the rise to the run, where the rise # is the difference in y values and the run is the difference in # x values # to get the rise, I need the difference in the y values rise = y2 - y1 # to get the run, I need the difference in the x values run = x2 - x1 # to get the result, I need the ratio of the rise to the run result = rise / run # hand back the result return result