from random import choice from string import letters digits ent letter

1
2
3
4
from random import choice
from string import letters, digits
ent = letters + digits
''.join(choice(ent) for x in xrange(20))