mercredi 14 septembre 2016

Can the random.randint have more than 2 variables?

For example;

if random.randint(1,2) == 1:
 strangth = 'weak'
else
 stregth = 'strong'

could I use it with the syntax;

if random.randint(1,2,3,4,5,6,7,8,9,0) == 1:
 strength = "1"
else
 strength = "2"
else
 strength = "3"

etc etc..?

Aucun commentaire:

Enregistrer un commentaire