The Soda Algorithm Sep 16th, 2011 I think the code speaks for itself. import random from imagination import count_soda, restock_soda available_sodas = ['Sprite', 'Coke', 'Diet Coke', 'Dr. Pepper'] def take_soda(): soda = random.choice(available_sodas) if count_soda(soda) < 2: restock_soda(soda) Like any piece of code open to the world, people are at liberty to make forks. Harley did just that, and I prefer his version. import random from imagination import count_soda, restock_soda available_sodas = ['Sprite', 'Coke', 'Diet Coke', 'Dr. Pepper'] def take_soda(consumer): soda = random.choice(available_sodas) if count_soda(soda) < 2 and not consumer.is_dick(): restock_soda(soda) else: pass