How to generate random string without repeating the characters in Python

1 Answer

0 votes
import random, string

random_characters = ''.join((random.sample(string.ascii_lowercase, 7)))   

print(random_characters)


'''
run:

svepbdo

'''

 



answered Sep 17, 2023 by avibootz
...