I am trying to find the minimum distance between two letters in the 'qwerty' keyboard, for example if i evaluating letters q and w the minimum distance should be 1, since they are together in the keyboard, letter q and e minimum distance should be 2 since they are just two position away from each
I was trying to create a dictionary for doing like
coords = {
'qw':1, 'qe':2, 'qr':3, 'qt':4, 'qy':5, 'qu':6, 'qi':7, 'qo':8, 'qp':9, 'qa':1, 'qs':2, 'qd':3,
'qf':4, 'qg':5, 'qh':6, 'qj':7, 'qk':8, 'ql':9, 'qz': 2, 'qx':3, 'qc':4, 'qv':5, 'qb':6, 'qn':7, 'qm':8,
'q1':1, 'q2':1, 'q3':2, 'q4':3, 'q5':4, 'q6':5, 'q7':6, 'q8':7, 'q9':8}
for afterwards doing something like this to find the value of the minimum distance for each two letters ( in only did it for one-side pair for letter q)
sentence = 'qw'
grams = [sentence[i:i+N] for i in range(len(sentence)-N+1)]
[coords[i] for i in grams]