mercredi 27 mai 2020

Can I randomize a list in Python using percentage?

Recently I've been working on a project where I need to put characters in random order with a limit, for example, if I have a list with 25,000 "_" in it, I need to set 4% (1,000) of these "_" into "X" in random positions.

The list that I'm working with is a bidimensional array.




Aucun commentaire:

Enregistrer un commentaire