I\'m trying to solve this problem from Timus Online Judge. To solve this problem you need generate a sequence of 1 000 000 lowercase Latin letters and write it to stdin in
Use random.choices?
On Python 3.6:
import random import string %timeit ''.join(random.choices(string.ascii_lowercase, k=10**6)) 1 loop, best of 3: 235 ms per loop