Repeat string certain length python 2 March 11, 2017 / Triplecodeblog from itertools import cycle, islice def srepeat(string, n): return ''.join(islice(cycle(string), n)) Share this:TwitterFacebookLike Loading... Related