AllenDowney / ThinkPython2

LaTeX source and supporting code for Think Python, 2nd edition, by Allen Downey.
Other
2.49k stars 1.65k forks source link

rotate_pairs does not find all possible rotate pairs #69

Open DavidVFitzGerald opened 3 years ago

DavidVFitzGerald commented 3 years ago

It appears that the function rotate_pairs (solution for Exercise 11.5) does not check for all rotated words, due to the stop argument of the range being 14 instead of 26. For example, passing the word "act" as argument should print out "act 24 yar", but currently does not print out anything. It's also possible to avoid iterating through all possible rotated words for each word in the list of words.