How do make a function that creates a sequence of n random numbers?

Diez B. Roggisch deets_noospaam at web.de
Tue Feb 17 14:54:26 EST 2004


import random

def rand_seq():
    while True:
        yield random.random()

for rn in rand_seq():
    print rn

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list