from random import randint seed = [] max_range = randint(1, 31) for i in range(0, max_range): if len(str(seed)) < 32: seed_bytes = randint(0, 9) seed.append(seed_bytes) else: break print(*seed, sep='')