I am a high school student who has just been introduced to python through school. Just for fun, I made a simple program for finding the point of intersection of two y=mx=b formulas. However, unless I put decimal points after the inputs, it rounds the output of the program. I have tried some things using floats but I don't fully understand it. Here is the code:
print("When inputting numbers, please make sure to add two decimal points at the end to make sure answer is not rounded")
x_one=input("Slope of line 1: ")
y_one=input("Y intercept line 1: ")
x_two=input("Slope of line 2: ")
y_two=input("Y intercept 2: ")
eliminator_1=(x_one*x_two)
eliminator_2=(y_one*x_two)
eliminator_3=(y_two*x_two)
eliminator_4=(y_two*x_one)
print(eliminator_1, eliminator_2, eliminator_3, eliminator_4)
formula_ypro=(eliminator_2-eliminator_4)
formula_y=formula_ypro/(x_two-x_one)
print(formula_y)
formula_x=((formula_y-y_one)/x_one)
print("the point of intersection is", formula_x, formula_y)
h=input("Press Enter To Exit")
I am using python 2.7. Thanks in advance!