>> if coinToss(1,2) == 1: >> heads += 1 >> tossNo += 1 >> else: >> tails += 1 >> tossNo += 1 > > Looking good. You can hoist "tossNo += 1" out of each branch of your if > statement too, if you like, to make it even more streamlined (In > other words, execute it once, right after the coin flip, and before > the if-statement). > > Alan
Ah right, I get you. i.e while tossNo <= 99: coinToss = random.randint tossNo += 1 if coinToss(1,2) == 1: heads += 1 else: tails += 1 That makes sense. :-) Chris _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor