How to select a random character from a set of characters in Python

1 Answer

0 votes
import random

st = set('abcdefghijklmnopqrstuvwxyz')

print(random.choice(tuple(st)))
print(random.choice(tuple(st)))
print(random.choice(tuple(st)))




'''
run:

u
g
j

'''

 



answered Aug 26, 2021 by avibootz
...