I want to generate random strings from a list of characters C (e.g. C = ['A', 'B', 'C', 'D']). This random string shall have length N (e.g. N = 32). Every character should occur equally often - in that example 8 times.
How can I implement that each character occurs equally often in here:
''.join(random.choice(C) for i in range(N))
Or is there a better way?
Aucun commentaire:
Enregistrer un commentaire