Advertisement
atanasovetr

Untitled

Mar 25th, 2019
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. import math
  2. import sys
  3. xc = float(input("x:"))
  4. yc = float(input("y:"))
  5. r = float(input("r:"))
  6.  
  7. while True:
  8.  
  9.     x = float(input("x= "))
  10.     y = float(input("y= "))
  11.  
  12.     dist = math.sqrt((x-xc) * (x-xc) + (y-yc) * (y-yc) )
  13.  
  14.     if dist == r:
  15.         print("Border")
  16.  
  17.     if dist < r:
  18.         print("Inside")
  19.  
  20.     if dist > r:
  21.         print("Outside")
  22.  
  23.     question = input("Do you want to continue: ")
  24.     if question == "yes":
  25.         continue
  26.     if question == "OVER" or "over" or "no":
  27.         sys.exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement