s = 'abc'n = 10dm = divmod(n, len(s))print(s * dm[0] + s[:dm[1]])
Standard input is empty
abcabcabca
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!