The variable
r
can be dispensed with as it is not necessary. You could also improve the while loop so it actually completes, as follows:
while (a != x or b != y):
if y>b:y-=1;print('North', y)
if y<b:y+=1;print('South', y)
if x<a:x+=1;print('East', x)
if x>a:x-=1;print('West', x)