Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Slope Finder by Umut Bilgic (GameNationRDF)
- def blank():
- print ("")
- print ("Example point input: 5,12")
- blank()
- while True:
- pos_1 = str(input("Point 1: "))
- pos_2 = str(input("Point 2: "))
- pos_1_list = pos_1.split(",")
- pos_2_list = pos_2.split(",")
- x1 = int(pos_1_list[0])
- y1 = int(pos_1_list[1])
- x2 = int(pos_2_list[0])
- y2 = int(pos_2_list[1])
- deltax = x2 - x1
- deltay = y2 - y1
- slope = deltax / deltay
- blank()
- print ("Slope 0f the line: " + str(slope))
- print ("--------------------------------")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement