Skip to content

Instantly share code, notes, and snippets.

@manikos
Last active March 15, 2018 15:35
Show Gist options
  • Save manikos/a23fe3b26293d48c68489f7567abb257 to your computer and use it in GitHub Desktop.
Save manikos/a23fe3b26293d48c68489f7567abb257 to your computer and use it in GitHub Desktop.
Probability graph
__author__ = 'Raymond Hettinger'
from collections import Counter
from random import random
c = Counter(round(sum(random() for i in range(150))) for j in range(600))
for i in range(min(c), max(c)+1):
print('*' * c[i])
# OUTPUT
*
*
**
********
************
************
*******************
*****************************************
****************************************
*******************************************************
************************************************************
***********************************************************************************
***********************************************************
***************************************************
***************************************************
*******************************************
********************
******************
**********
*****
*****
**
*
*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment