I have followed the lecture but found myself very confused with this piece of code, if someone can explain it to me I would be very grateful, remember I am just a beginner.
def point_maker(x, y):
return x, y
a = point_maker(0, 10)
b = point_maker(5,3)
def calculate_slope(point_a, point_b):
return (point_b[1] - point_a[1])/(point_b[0] - point_a[0])
print "The slope between a and b is {0}".format(calculate_slope(a, b))
(The output)
The slope between point a and b is -2.