absolute value
situation: my programm gets 4 int(input()) the first 2 inputs are the x coordinate and the second 2 inputs are the y coordinate on a chess board. Now the program should know if the bishop can go or not. my code is simple: # bishop move x1 = int(input()) y1 = int(input()) x2 = int(input()) y2 = int(input()) if abs(x1 - y1) == abs(y2 - x2): print("YES") else: print("NO") if I do the evaluation then this code can run some examples and others not. can anybody of you help me to find out why? for example if the bishop goes from 4,4 (4D) to 5,3 (5C) then i get a wrong result. I have now idea why because the absolute value is both time same big. now my question: can I not say abs(xy) == abs(xy)? do i have to use other ways? thanks for help