Skip to content

Instantly share code, notes, and snippets.

@stober
Created May 10, 2011 18:22
Show Gist options
  • Save stober/965049 to your computer and use it in GitHub Desktop.
Save stober/965049 to your computer and use it in GitHub Desktop.
Flip a Coin
import random as pr
def flip(p):
""" Flip a biased coin. """
if pr.random() < p:
return True
else:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment