mardi 4 juin 2019

Error when trying to fix the seed in the random module

When I execute the following code :

import random
random.seed(3)

I get the error :

'int' object is not callable

I looked up the documentation, but I can't see what I'm doing wrong (I'm using python 3.6).

I also tried to fix the seed like this :

import random
random.seed = 3
print(random.randint(0,10))

but I keep getting different numbers, so the seed is not fixed




Aucun commentaire:

Enregistrer un commentaire