Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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))

                                  
Source by www.journaldev.com #
 
PREVIOUS NEXT
Tagged: #generate #random #string #python
ADD COMMENT
Topic
Name
7+6 =