mercredi 14 avril 2021

How to create a random list with condition in python?

I want to create a list of zeros and ones only in a random manner but i want the list to contain at least two ones. Like this example: Liste= [0,1,1,0,0,0] , liste=[1,1,0,1,0] and so on. Thank u in advance




Aucun commentaire:

Enregistrer un commentaire