Skip to content

Instantly share code, notes, and snippets.

@kblake
Created September 28, 2015 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kblake/9caeb8ac8db52783d03d to your computer and use it in GitHub Desktop.
Save kblake/9caeb8ac8db52783d03d to your computer and use it in GitHub Desktop.
Histogram
test_scores = [88, 100, 93, 65, 89, 90, 78, 99, 54]
If given an array of integers, display a horizontal histogram using ‘*’
For example,
Produce:
88 : ****************************************************************************************
100: ****************************************************************************************************
93 : *********************************************************************************************
65 : *****************************************************************
89 : *****************************************************************************************
90 : ******************************************************************************************
78 : ******************************************************************************
99 : ***************************************************************************************************
54 : ******************************************************
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment