Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- x1 = 0
- x2 = 0
- y1 = 0
- y2 = 0
- def inputs():
- global x1
- global x2
- global y1
- global y2
- x1 = int(input("Prosze podać x1: "))
- x2 = int(input("Prosze podać x2: "))
- y1 = int(input("Prosze podać y1: "))
- y2 = int(input("Prosze podać y2: "))
- print("Prosze o wprowadzenie wpspółrzędnych \n")
- while True:
- try:
- inputs()
- a = x2 - x1
- b = y2 - y1
- d = a **2 + b **2
- c = math.sqrt(a ** 2 + b ** 2)
- print(d)
- print(c)
- break
- except:
- print("Coś poszło nie tak przy wporwadzaniu koordynatów")
- print("Proszę prowadzić jeszcze raz !")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement