jeudi 9 mars 2017

How do you allow repeats when generating random colors in python?

I have a list like this: colors = ["red", "blue", "yellow", "green", "purple", "orange"] answers = random.sample(colors, 4)

I am having trouble trying to figure out how to allow repeats like red,red,blue,yellow when generating random colors.

Aucun commentaire:

Enregistrer un commentaire