So I am trying to make a piece of code that calculates the slope of a line. I am using 3.6.
y1 = float(input("First y point: "))
y2 = float(input("Second y point: "))
x1 = float(input("First X point: "))
x2 = float(input("Second X point: "))
slope = (y2 - y1)/(x2 - x1)
print("The slope is:",slope)
Whenever I put in numbers that make the answer irrational, the answer comes to be a decimal. Is it possible to keep it as a fraction?