On second prompt, it asks you to create a function to calculate the difference between a point and the linear function. Can someone explain the syntax/logic for the point input from the function and how within the function point is then designated as x_point, y_point?

def calculate_error(m, b, point): x_point, y_point = point
y = m*x_point + b
distance = abs(y - y_point)
return distance

Given you’ve got an x_point and a y_point, I am presuming you’re working with 2-dimensional Cartesian co-ordinates.

Hence, your point will be an (x,y) co-ordinate one assumes.

By passing in a tuple, when we do x_point, y_point = point the tuple is expanded out so that the first item of the tuple goes to the first declared variable, and the second item to the second variable. Like so:

>>> point = (2,4)
>>> x_point, y_point = point
>>> x_point
2
>>> y_point
4
>>>

Edit: I’m not a Pro user, and have no access to that course material, so this is a bit of a guess.