Write a Python program using the Matplotlib library to display the number of robots used in different sectors as shown below:

ICSE Class 10 Robotics & AI PYQ · 2027 Specimen · Section B

3(iii)Written · 2027 · Section B · 2027 Specimen

Write a Python program using the Matplotlib library to display the number of robots used in different sectors as shown below:

SectorNumber of Robots
Healthcare20
Agriculture15
Manufacturing30
Education10

The program should:

1. Import the required Matplotlib library.

2. Create suitable lists for sectors and the corresponding number of robots.

3. Plot a bar graph.

4. Label the X-axis as "Sectors".

5. Label the Y-axis as "Number of Robots".

6. Give the graph a suitable title.

7. Display the graph.

Show SolutionHide Solution↓
import matplotlib.pyplot as plt

sectors = ['Healthcare', 'Agriculture', 'Manufacturing', 'Education']
robots = [20, 15, 30, 10]

plt.bar(sectors, robots)
plt.xlabel("Sectors")
plt.ylabel("Number of Robots")
plt.title("Number of Robots in Different Sectors")
plt.show()

Output

Write a Python program using the Matplotlib library to display the number of robots used in different sectors as shown below:. Specimen Paper 2027, ICSE 2026 Robotics & Artificial Intelligence Solved Question Paper.
← Previous questionNext question →

Browse the free Robotics & AI sample bank