import random, string ran = ''.join(random.choices(string.ascii_letters + string.digits, k=16)) print(ran)