Write a Python program to plot a bar chart using the Matplotlib library. Your program should do the following:

ICSE Class 10 Robotics & AI PYQ · 2025 Paper · Section B

3(iii)Written · 2025 · Section B · 2025 Paper

Write a Python program to plot a bar chart using the Matplotlib library. Your program should do the following:

Show SolutionHide Solution↓
import matplotlib.pyplot as plt
categories = ['A', 'B', 'C', 'D']
values = [10, 20, 15, 25]
plt.bar(categories, values)
plt.xlabel('Categories')
plt.ylabel('Values')
plt.title('Bar Chart Example')
plt.show()

Output

Write a Python program to plot a bar chart using the Matplotlib library. Your program should do the following. ICSE 2025 Robotics & Artificial Intelligence Solved Question Paper.
← Previous questionNext question →

Browse the free Robotics & AI sample bank