import random import string reps=10 length=4 for _ in range(reps): id=str.lower(''.join(random.choices(string.hexdigits, k=length))) print(id)