mercredi 30 mars 2022

how can I get a random generation of yes and no?

how can I get a random generation of yes and no? and result store in dataframe column.

I want to the random generation of yes and no and store value in the column but still not successful... here is my code, it's working well but does not store the same result in the column.

import string
import random
l1 = ["yes", "no"]
for x in range(8):
    rand = random.randint(0, 1)
    print(l1[rand])



Aucun commentaire:

Enregistrer un commentaire