Write a program to create a list representing the results of 100 students in a test, where each element represents a student's marks (between 0 to 10), and display a histogram for the result in python

Code

import matplotlib.pyplot as plt


testscores= [5,2,1,5,6,10,3,7,4,2,10,6,2,7,4,7,10,6,8,9,7,10,7,2,1,0,3,4,5,6,8,9,10,7,6,5,4,3,2,1,0,1,2,3,4,5,6,7,8,9,10,7,6,5,4,3,2,1,0,1,2,3,4,5,6,7,8,9,10,7,6,5,4,3,2,1,0,1,2,3,4,5,6,7,8,9,10,7,6,5,4,3,2,1,0,1,2,3,4,5]

bins=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

plt.hist(testscores, bins, histtype='bar', rwidth=0.8)

plt.show()


Output

run and see your output