You have splittedsplit your code into multiple functions, documented them, and written the usual if __name-- == 'main': test : this is already a pretty good beginning.
Also, pep8 only complies about some whitespaceswhitespace not following the Python Style Guide (this is worth fixing it anyway).
- your code can be python 3 compliant by adding parenthesisparentheses in your calls to
print. - you have the same typo
roratein multiple places listis a bad name for a list as you can easily mix-up with the type- your function and variable names doesdo not follow the convention.
In Programming Pearls (sorry I couldn't find the relevant full text), Jon Bentley describes different solutions to the problem. Some behindare quite original and actually very easy to implement on top of being efficient. I'll let you google "programming pearls rotate" if you want to read more about this. It is defintlydefinitely worth a read (and the whole book is too).