Skip to content

Instantly share code, notes, and snippets.

@ColtonPhillips
Created August 21, 2014 05:09
Show Gist options
  • Save ColtonPhillips/6fce84fb3e223ed54ca4 to your computer and use it in GitHub Desktop.
Save ColtonPhillips/6fce84fb3e223ed54ca4 to your computer and use it in GitHub Desktop.
A one in N chance that something happens. Lol. So random.
import random
random.seed()
def chance(_n):
return random.randint(1,_n) == _n
a=0
for i in range(10000):
if (chance(10)):
a=a+1
#~1000
print(a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment