[Tutor] Sum of Scores

Luke Paireepinart rabidpoobear at gmail.com
Fri Jul 27 01:26:12 CEST 2007


bhaaluu wrote:
> Greetings,
>
> Beautiful! Thank you SO much for all the variations.
> I'm so sure I'll have much to learn from them. This
> is exactly the kind of stuff I'm currently studying.
>
> I have a question for the list.
> After I posted my snippet, I added time to import,
> and a time.sleep(1) line to the code. The reason
> I did this is because I'm under the (possibly mistaken?)
> impression that random uses the computer
> time as a random number generator 'seed',
> for generating pseudo-random numbers?
>   
It uses time, it may also use other things.
However, this is only to initialize the random number generator.
You only need one seed and from that you can generate an infinitely long 
string of pseudo-random numbers.
In other words, the only way you'd end up getting the same value is if 
you ran the program, quit it, then ran it again, in less than a second.
(or possibly reloaded the module)
But you can call the random functions in your code as often as you want 
safely.
> Perhaps this is a question for the 'language lawyers'?
>   
Not sure what this means.
-Luke


More information about the Tutor mailing list