Histogram X87317


Statement
 

pdf   zip

  1. Design the function @histograma_h(lis)@ which, given a list @lis@ of digits or letters, writes the resulting horizontal histogram, with the legend in alphabetical order.

  2. Design the function @histograma_h(lis)@ which, given a list @lis@ of digits or letters, writes the resulting vertical histogram, with the legend in alphabetical order.

Observation

Part of the solution is to reuse the exercise X79485 Freqüències.

Sample session

Sample session
>>> histograma_h([1, 3, 2, 4, 2, 2, 3, 2, 4, 1, 2, 1, 2, 3, 1, 3, 1])
1 *****
2 ******
3 ****
4 **

>>> histograma_v([1, 3, 2, 4, 2, 2, 3, 2, 4, 1, 2, 1, 2, 3, 1, 3, 1])
  *     
* *     
* * *   
* * *   
* * * * 
* * * * 
1 2 3 4 
Information
Author
InfBesos
Language
English
Translator
Original language
Spanish
Other languages
Catalan Spanish
Official solutions
Python
User solutions
Python