Another stupid newbie question

Byte eoinrogers at gmail.com
Fri Feb 17 14:15:09 EST 2006


How can I make the following code:

from random import random



def stuff(a, mx):
    x = 2
    while x == 2:
        x = random()
        if x == mx: print x
        else: print 'No luck,', x
        x = 2

Stop when x == mx?

Thanks in advance,
 -- /usr/bin/byte




More information about the Python-list mailing list