#!/usr/bin/env python3

import random
import string

f = open("random.txt", "w")
for i in range(0, 100):
    # Add [0], otherwise TypeError exception triggered
    r = ''.join(random.choices(string.ascii_lowercase + string.digits + string.punctuation)[0] for _ in range(10))
    print(r)
    f.write(f"{r}\n")
f.close()
