KnowledgeBoat Logo
|

Informatics Practices

Write the output from the given python code :

import matplotlib.pyplot as plt
Months = ['Dec', 'Jan', 'Feb', 'Mar']
Attendance = [70, 90, 75, 95]
plt.bar(Months, Attendance)
plt.show()

PyPlot

1 Like

Answer

Output
Write the output from the given python code : Plotting with Pyplot, Informatics Practices Computer Science Sumita Arora Solutions CBSE Class 12
Explanation

This code snippet uses Matplotlib to create a bar chart. The list Months contains the names of the months ['Dec', 'Jan', 'Feb', 'Mar'], while the list Attendance holds corresponding attendance values [70, 90, 75, 95]. The plt.bar() function is then used to create a bar plot, where each bar represents a month and its height corresponds to the attendance value. Finally, plt.show() is called to display the plot.

Answered By

2 Likes


Related Questions