On Thu, 2007-09-06 at 11:00 -0700, Scott David Daniels wrote: > def d6(count): > result = 0 > for die in range(count): > result += random.randint(1, 6) > return result
This, of course, can be further improved into: def d6(count): return sum(random.randint(1, 6) for die in range(count)) -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list