Last active
March 15, 2018 15:35
-
-
Save manikos/a23fe3b26293d48c68489f7567abb257 to your computer and use it in GitHub Desktop.
Probability graph
This file contains 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
__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