KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Write a Python program to plot a pie chart comparing marks of five students as given below:

stud_name = ['Jessica', 'Peter', 'Alexa', 'James', 'Ram']
marks = [48, 22, 14, 30, 49]

Import the necessary libraries.

Python Modules

1 Like

Answer

import matplotlib.pyplot as plt

stud_name = ['Jessica', 'Peter', 'Alexa', 'James', 'Ram']
marks = [48, 22, 14, 30, 49]

plt.pie(marks, labels=stud_name)
plt.title("Marks of Students")
plt.show()

Output

Write a Python program to plot a pie chart comparing marks of five students as given below.ICSE 2026 Robotics & Artificial Intelligence Solved Question Paper.

Answered By

1 Like


Related Questions