lundi 12 juin 2017

In numpy, how can I randomly choose a number from a range that excludes a random number that was previously chosen?

For example:

open_door = np.random.randint(1,4)
prize_behind_door = np.random.randint(1,4)
change_door = np.random.randint(1,4)

But I don't want change_door to have a value that is the same as open_door, while it is still random (so it can be equal to prize_behind_door), what commands should I use?




Aucun commentaire:

Enregistrer un commentaire