KnowledgeBoat Logo

Informatics Practices

During a practical exam, a student Ankita has to fill in the blanks in a Python program that generates a bar chart. This bar chart represents the number of books read by four students in one month.

Student NameBooks Read
Karan12
Lina9
Raj5
Simran3

Help Ankita to complete the code.

During a practical exam, a student Ankita has to fill in the blanks in a Python program that generates a bar chart. This bar chart represents the number of books read by four students in one month. CBSE 2025 Computer Science Class 12 Sample Question Paper Solved.

import _____ as plt #Statement-1 
students = ['Karan', 'Lina', 'Raj', 'Simran'] 
books_read = [12, 9, 5, 3] 
plt.bar( students, _____, label='Books Read') #Statement-2 
plt.xlabel('Student Name') 
plt._____('Books Read') #Statement-3 
plt.legend() 
plt.title('_____') #Statement-4 
plt.show()

I. Write the suitable code for the import statement in the blank space in the line marked as Statement-1.

II. Refer to the graph shown above and fill in the blank in Statement-2 with suitable Python code.

III. Fill in the blank in Statement-3 with the name of the function to set the label on the y-axis.

IV. Refer the graph shown above and fill the blank in Statement-4 with suitable Chart Title.

PyPlot

1 Like

Answer

I. matplotlib.pyplot

II. books_read

III. ylabel

IV. Number of Books Read by Students

Answered By

1 Like


Related Questions