Created
December 3, 2014 16:21
-
-
Save drvinceknight/6dbebcfdf1813196aa2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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