calculating a self.value, self.randomnum = normalvariate(x, y)

Vincent Davis vincent at vincentdavis.net
Sat Jun 20 07:20:22 CEST 2009


I currently have something like this.

class applicant():
    def __int__(self, x, y):
        self.randomnum = normalvariate(x, y)
then other stuff

x, y are only used to calculate self.randomnum   and this seems to
work. But I want self.randomnum to be 0 <= randomnum <= 100. The only
way I can thing of to do this is is with a while statement and that
seems more complicated than necessary. I would really like to keep it
on one line. How would I do that?

Thanks
Vincent Davis



More information about the Python-list mailing list