Cats and a Mouse

Photo by Rick Lam on Unsplash
def catAndMouse(x, y, z):
cat_a,cat_b,mouse=x,y,z
if (abs(cat_a-mouse))<(abs(cat_b-mouse)):
return "Cat A"
elif (abs(cat_a-mouse))==(abs(cat_b-mouse)):
return "Mouse C"
else:
return "Cat B"

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store