Skip to content

Instantly share code, notes, and snippets.

@evjeny
Created October 10, 2017 14:10
Show Gist options
  • Save evjeny/df2a4ed5ed1539209d1719a2a45b412d to your computer and use it in GitHub Desktop.
Save evjeny/df2a4ed5ed1539209d1719a2a45b412d to your computer and use it in GitHub Desktop.
Task1.py
def abs(k):
if k>=0:
return k
else:
return -k
def dist(ax,ay,bx,by):
if ax == bx:
return abs(ay-by)
elif ay==by:
return abs(ax-bx)
return ((ax-bx)**2+(ay-by)**2)**0.5
ax,ay = [int(i) for i in input().split()]
bx,by = [int(i) for i in input().split()]
a = abs(ax-bx)
b = abs(ay-by)
mn = min(a,b)
mx = max(a,b)
sqs = mn
print(sqs+(mx-mn))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment