a = 5 b = 2 print('a is %i, b is %i' %(a, b)) a = b - a # a is now the diff b = b - a # b is a a = a + b # a is a + the diff (aka b) print('a is %i, b is %i' %(a, b))