Answers for "python generate random string of letters"

5

random letter generator python

import random
import string
random.choice(string.ascii_letters)
Posted by: Guest on May-10-2020
4

generate random string python

import string
import random

length=5
#python2
randomstr = ''.join(random.sample(string.ascii_letters+string.digits,length))


#python3
randomstr = ''.join(random.choices(string.ascii_letters+string.digits,k=length))
Posted by: Guest on May-11-2020

Code answers related to "python generate random string of letters"

Python Answers by Framework

Browse Popular Code Answers by Language