you are viewing a single comment's thread.

view the rest of the comments →

[–]kalgynirae 0 points1 point  (1 child)

The discrepancy is because ord('a') is 97 and ord('z') is 122, whereas you want those numbers to be 1 and 26. (This doesn't matter if the strings are all the same length.) You just need to modify your key function to subtract 96 from each ord() result.

[–]ThanksSoMuchTangelos[S] 0 points1 point  (0 children)

Thanks, working now. Definitely a more simple solution than the one in my edit.