def euclidean_distance(a, b):
    X = (keyboard_cartesian[a]['x'] - keyboard_cartesian[b]['x']) ** 2
Y = (keyboard_cartesian[a]['y'] - keyboard_cartesian[b]['y']) ** 2
return sqrt(X + Y)
euclidean_distance('q', 'w')
Edit distance such as Levenshtein taking into account proximity on keyboard