SEESathi
HomeSubjectsPast PapersMock TestSavedSearch
SEESathi

Empowering every Class 10 student across Nepal with world-class, beautifully structured study notes and solved questions.

Study

  • Master Notes
  • Question Bank
  • Past Papers

Subjects

  • Science & Technology
  • English
  • नेपाली
  • Social Studies
  • Computer Science
  • Mathematics

Resources

  • SEE Grading Guide
  • Syllabus Breakdown
  • Topper Answer Sets
  • Mock Test Simulator

Legal

  • About Mission
  • Editorial Board
  • Privacy Policy
  • Terms of Use

© 2026 SEE Sathi Technologies Pvt. Ltd. Kathmandu, Nepal.

Built for every Class 10 student across Nepal

Python — Introduction to Data VisualizationSolved Questions· Unit 4
Computer Science · Chapter 04f
18 solved questions

Programming In Python - 4.6 Introduction To Data Visualization

Every question in this chapter, answered and explained — step-by-step solutions drawn live from the chapter library across 5 question sections.

Concept in Practice 8 — Data Visualization9Level 1 — Basic3Level 2 — Standard (Output Tracing)2Level 3 — SEE Style2Level 4 — Application (Debugging)2
01

Concept in Practice 8 — Data Visualization

9
1Textbookcs6-q1

Which method is used to create a horizontal bar chart in Matplotlib?

Ans.b) plt.barh()
2Textbookcs6-q2

What is the primary purpose of data visualization?

Ans.b) To display data in a graphical format for better understanding
3Textbookcs6-q3

Which Python library is commonly used for creating visualizations like line charts, bar charts, and pie charts?

Ans.b) matplotlib
4Textbookcs6-q4

Which method is used to create a line chart in Matplotlib?

Ans.d) plt.plot()
5Textbookcs6-q5

In a line chart, what does the marker parameter do?

Ans.b) Draws a symbol at each data point
6Textbookcs6-q6

Which method is used to create a pie chart in Matplotlib?

Ans.c) plt.pie()
7Textbookcs6-q7

In a pie chart, which parameter is used to display percentage labels on each slice?

Ans.c) autopct
8Textbookcs6-q8

Which method is used to create a vertical bar chart in Matplotlib?

Ans.a) plt.bar()
9Textbookcs6-q9

In a bar chart, what does the width parameter control?

Ans.c) Thickness of the vertical bars
02

Level 1 — Basic

3
1Textbookcs9-q1

Define a library in Python with one example.

Ans.A library is a collection of pre-written functions and modules that can be reused to perform specific tasks without writing code from scratch. Example: the math library, which provides functions like sqrt() and pow().
2Textbookcs9-q2

Write any two file modes in Python and their uses.

Ans.'r' (read) mode opens a file for reading only and gives an error if the file doesn't exist. 'w' (write) mode opens a file for writing, creating it if it doesn't exist, and overwrites existing content.
3Textbookcs9-q3

What is the use of the finally block in error handling?

Ans.The finally block always runs, whether an error occurs in the try block or not. It is commonly used to close a file or display a closing message so that important clean-up code always executes.
03

Level 2 — Standard (Output Tracing)

2
1Textbookcs10-q1

What will be the output of the following code? import math print(math.floor(9.9)) print(math.ceil(9.1))

Ans.9 10 (math.floor(9.9) rounds down to 9; math.ceil(9.1) rounds up to 10)
2Textbookcs10-q2

What will be the output of the following code? try: x = 10 / 0 except ZeroDivisionError: print("Cannot divide by zero") else: print("Division successful") finally: print("Done")

Ans.Cannot divide by zero Done (The ZeroDivisionError is caught by except, so the else block is skipped, but the finally block always runs)
04

Level 3 — SEE Style

2
1Textbookcs11-q1

Write a Python program to read a CSV file named marks.csv using pandas and display only the first 3 records using head().

Ans.import pandas as pd marks = pd.read_csv("marks.csv") print("First 3 Records:") print(marks.head(3))
2Textbookcs11-q2

Write a Python program to draw a pie chart showing the percentage of students choosing three subjects: Math (20), Science (15), and Computer (25), with labels and percentage values displayed.

Ans.import matplotlib.pyplot as plt subjects = ['Math', 'Science', 'Computer'] students = [20, 15, 25] plt.pie(students, labels=subjects, autopct='%1.1f%%', startangle=90) plt.title("Favorite Subjects of Students") plt.show()
05

Level 4 — Application (Debugging)

2
1Textbookcs12-q1

Find the error and correct the following program: import Math print(math.squrt(9))

Ans.Incorrect Program: import Math print(math.squrt(9)) Explanation: 'Math' should be lowercase 'math' since Python module names are case-sensitive, and the function name should be 'sqrt' not 'squrt'. Correct Program: import math print(math.sqrt(9))
2Textbookcs12-q2

Find the error and correct the following program: for i in range(1,5) if i = 3: brek print(i)

Ans.Incorrect Program: for i in range(1,5) if i = 3: brek print(i) Explanation: The for statement is missing a colon (:); the condition should use '==' for comparison, not '='; and 'brek' should be 'break'. Correct Program: for i in range(1, 5): if i == 3: break print(i)
Review the NotesBack to Chapter