def distance(a, b): return a^b # In python, this means a XOR b, # not a to the power of b.