Answer to Question #320281 in Python for Chany

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

1
Expert's answer
2022-03-29T16:48:42-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS