You are viewing a single comment's thread. Return to all comments →
I thought using a dictionary of exclusive boolean statements would be fun
`def catAndMouse(x, y, z):
catA_dist = abs(x-z) catB_dist = abs(y-z) d = {catA_dist < catB_dist:'Cat A', catA_dist > catB_dist:'Cat B', catA_dist == catB_dist:'Mouse C', } return d[True]
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Cats and a Mouse
You are viewing a single comment's thread. Return to all comments →
I thought using a dictionary of exclusive boolean statements would be fun
`def catAndMouse(x, y, z):