vendredi 19 octobre 2018

Python random.choice same output

I'm trying to random some strings in a variable,

myTest = random.choice("test1","test2","test3")
print(myTest)
print(myTets)
print(myTest)

And when I'm running my script all of them are the same every time,

test1
test1
test1

I like to random my variable every time I'm calling it, like,

test1
test3
test2




Aucun commentaire:

Enregistrer un commentaire