Question: Write a program called histogram.py that takes in a list of marks (separated by spaces) and outputs a histogram representation of the marks according to
Write a program called histogram.py that takes in a list of marks (separated by spaces) and outputs a histogram representation of the marks according to the mark categories at UCT: fail < 50% 50% <= 3rd < 60% 60% <= lower 2nd < 70% 70% <= upper 2nd < 75% 75% <= first From the given marks, count the number of marks that satisfy the conditions of each category. For example, for the following list of marks: 32 67 54 90 77, there is one fail, one 3rd, one lower 2nd, no upper 2nds and two firsts. Then print out horizontal bars, using "X", that correspond to the counters, along with some hard-coded axes and labels to represent a histogram. You should use an array/list to store the counters. Version 2024/04/09 10:35:03 Page 2 of 5 Sample IO (The input from the user is shown in bold font do not program this): Enter a space-separated list of marks: 12 23 34 45 56 67 78 89 90 1 |XXX 2+| 2-|X 3 |X F |XXXX
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
