RJ: >import random >flip = random.randrange(2) >heads = 0 >tails = 0 >count = 0 >while count < 100: > if flip == 0: > heads += 1 > else: > tails += 1 > count += 1
Since flip isn't changed in the loop, this is going to report 100 heads or 100 tails, depending on the zeroness of flip. -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list