[Edu-sig] casino math (unit three)

2009-08-31 Thread kirby urner
This might be from a 3rd hour in our "casino math" segment. There's no "deep math" here, just getting familiar with dot notation, methods disguised as attributes (properties): import random class Deck: def __init__(self): self.deck = [ (suit + str(rank))

[Edu-sig] Another idea of Conway

2009-08-31 Thread Gregor Lingl
Hi all, on vacation in the Tyrolean Alps one evening I've found the time to implement another (I assume less well known) idea of John Conway. Just for fun. from fractions import Fraction fracs = [Fraction(f) for f in "17/91 78/85 19/51 23/38 29/33 77/29 95/23 77/19 1/17 11/13 13/11 15/14 15/