The slope of a line between two points (x1, y1) and (x2, y2) can be computed using the following formula: slope = (y2-y1)/(x2-x1). In Python, you can use this formula to write a program that takes the x and y coordinates of two points as input, calculates the slope, and returns the result. Here's an example of how you could write this program:
def slope(x1, y1, x2, y2):
return (y2-y1)/(x2-x1)
print(slope(1, 2, 3, 4)) # Output: 1.0