Question #320281

how would one say a number is closer to another number than a another number if u know what I mean





Like say we have...







X






We wanna see if





X





Is closer to y





Or closer to w

Expert's answer

x = int(input("Distance"))
my = int(input("Distance 2"))
w = int(input("Distance  3 "))
if x - my >= w - my:
    print("w nearer ")
else:
    print("my nearer")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS