Suppose we have a straight line in the form y = mx + b, where m is slope and b is y-intercept. And have another coordinate point (x, y). We have to check whether this coordinate point lies on that straight line or not.
So, if the input is like m = 3 b = 5 point = (6,23), then the output will be True as if we put the given x and y coordinate values on the straight line equation then it will satisfy.
To solve this, we will follow these steps −
Let us see the following implementation to get better understanding −
def solve(m, b, point): if point == (m * point) + b: return True return False m = 3 b = 5 point = (6,23) print(solve(m, b, point))
3, 5, (6,23)