deal or no deal

rbt rbt at athop1.ath.vt.edu
Thu Dec 22 09:29:49 EST 2005


The house almost always wins or are my assumptions wrong...

import random

amounts = [.01, 1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 750,
            1000, 5000, 10000, 25000, 50000, 75000, 100000, 200000,
            300000, 400000, 500000, 750000, 1000000]

results = []

count = 0
while count < 10:
     count = count + 1
     pick = random.choice(amounts)
     if pick < 100000:
         results.append("NBC won... Your briefcase contains $%s" %pick)
     else:
         results.append("You won... Your briefcase contains $%s" %pick)

results.sort()
print "Here are 10 random picks: "
for result in results:
     print result



More information about the Python-list mailing list