vendredi 26 janvier 2018

Python behavior of default RNG across multiple consecutive executions

I have a program that does seem thing like this regarding random functionality.

import random
for I in range (10):
     myarray.append (random.randint (0,4))

My question is this:

I designed my program in such a way that I could run it multiple consecutive times, and each time it runs it saves it's results in a data file and picks up where you left off each time u run it (new results are appended to the old datafile)

So my compsci teacher told me this could be dangerous because I might disrupt the uniform random distribution by rerunning the program multiple consecutive times. Is this a problem in python? How can I fix it in an easy way?




Aucun commentaire:

Enregistrer un commentaire