Skip to content

Instantly share code, notes, and snippets.

@drvinceknight
Created December 3, 2014 16:21
Show Gist options
  • Save drvinceknight/6dbebcfdf1813196aa2a to your computer and use it in GitHub Desktop.
Save drvinceknight/6dbebcfdf1813196aa2a to your computer and use it in GitHub Desktop.
"""
Going to simulate 100 '1st two days of xmas'
"""
from __future__ import division
import random
partidges = []
turtle_doves= []
for xmas in range(100):
partidges.append(random.choice([0,1,1,1,2]))
turtle_doves.append(random.choice([1,3,3,3,3]))
print sorted(partidges)
print sorted(turtle_doves)
print 'The mean number of partidges is %s' % (sum(partidges)/len(partidges))
print 'The mean number of turtle doves is %s' % (sum(turtle_doves)/len(turtle_doves))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment