Skip to content

Instantly share code, notes, and snippets.

s=''
while'BYE'!=s:s=raw_input();print["HUH?! SPEAK UP, SONNY!","NO, NOT SINCE %d!"%(1930+id(s)%21)][s.isupper()]
@mfilmer
mfilmer / randTest.py
Created September 6, 2012 14:31
Test coin flip randomization against random.random()
import random
whichTest = True #True -> python's random
#False -> coin flip random
outputFileName = 'porOutput.txt' if whichTest else 'testOutput.txt'
with open(outputFileName,'w') as f:
x = 0.0
inc = 0.01
f.write('desired probability, true count, false count, actual probability\n')