import random, string
x = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase +
    string.digits) for _ in range(16))
print(x)
Efficiently generate a 16-character, alphanumeric string