[Python Wpg] Tested seed()

Mike Pfaiffer high.res.mike at gmail.com
Thu Jun 28 01:05:05 EDT 2007


	Here is some code.

#!/usr/bin/python

from random import seed, randint

seed(2)
for c in range(10):
     print c,randint(1,10)


	Ran it twice under idle and the same results came out three times. 
Looks like it is best to run it without a value in seed().

	Here is what I got...

IDLE 1.2.1
 >>> ================================ RESTART 
================================
 >>>
0 10
1 10
2 1
3 1
4 9
5 8
6 7
7 4
8 7
9 7
 >>>

				Later
				Mike




More information about the Winnipeg mailing list