AI Logic School

Empowering Students with AI & Computational Thinking

Class 10 AI Practical File 2025-26 | 15 Python Programs with Output | CBSE Code 417

CBSE · Code 417 · Class X · 2025-26

📘 Class 10 AI Practical File
15 Python Programs with Output

Based on Official CBSE Syllabus · Basics to Advanced · Free PDF Download

✅ 100% CBSE Aligned 🐍 Python 3 📊 NumPy · Pandas · Matplotlib · PIL 📥 Free PDF 🔬 Viva Questions Included
⬇️ Download Free PDF

Google Drive · Class10_AI_Practical_File_2025-26.pdf

📄

🎁 Free Download — Class 10 AI Practical File PDF 2025-26

Complete file with 15 Python Programs · Aim · Code · Output · Viva Questions · Marking Scheme · Jupyter Notebook Installation Guide. Prepared as per CBSE Code 417 official syllabus.

15
Python Programs
6
CBSE Units Covered
20
Marks (Practical)
417
Subject Code
15
Viva Questions
📋 Official CBSE Syllabus Overview — Code 417
Total Marks: 100 = Theory 50 + Practical 50  |  Practical File: Minimum 15 Programs required  |  Session: 2024–25 / 2025–26
Unit 1 · Part B
Introduction to AI
Human intelligence, AI concepts, domains — Data Science, Computer Vision, NLP. AI Ethics & Bias.
Unit 2 · Part B
AI Project Cycle
Problem Scoping → Data Acquisition → Data Exploration → Modelling → Evaluation.
Unit 3 · Part B (Practical)
Advance Python
Jupyter Notebook, virtual environment, Python basics, built-in functions, libraries.
Unit 4 · Part B (Theory + Practical)
Data Science
NumPy, Pandas, Matplotlib · Mean, Median, Mode, Std Dev · Data Visualisation.
Unit 5 · Part B (Theory + Practical)
Computer Vision
OpenCV · Image pixels, RGB, grayscale · Image shape · Basic image processing.
Unit 6 · Part B
Natural Language Processing
Chatbots, text normalisation, Bag-of-Words, NLTK (optional). NLP applications.
📊 Practical Marks Distribution (Part C + D)
ComponentSub-ComponentMarks
Part C — Practical WorkPractical File (min. 15 programs)15
Practical Exam — Unit 3: Advance Python5
Practical Exam — Unit 4: Data Science5
Practical Exam — Unit 5: Computer Vision5
Part C — Viva VoceQuestions on programs and concepts5
Part D — Project WorkProject / Field Visit / Portfolio10
Part D — Viva VoceProject viva5
GRAND TOTAL (Practical)50 Marks
⚙️ How to Install Jupyter Notebook — Step by Step
Required before starting practicals: Python 3, Jupyter Notebook, NumPy, Pandas, Matplotlib, Pillow (PIL), SciPy. All are free and open-source.
1
Download & Install Python 3

Go to python.org/downloads → Download Python 3.x for your OS (Windows / Mac / Linux).
⚠️ Windows users: tick "Add Python to PATH" before clicking Install.

2
Open Command Prompt / Terminal

Windows: Press Win + R → type cmd → press Enter.
Mac/Linux: Open Terminal from Applications.

3
Install Jupyter Notebook

Type and press Enter:  pip install notebook

4
Install All Required Libraries

Run these one by one:
pip install numpy   pip install matplotlib   pip install pandas   pip install Pillow   pip install scipy

5
Launch Jupyter Notebook

Type: jupyter notebook  — Jupyter opens automatically in your browser.

6
Create a New Notebook

Click New → Python 3. Type code in a cell and press Shift + Enter to run.

7
Save Your Work

Press Ctrl + S. Your file saves as a .ipynb notebook in the current folder.

📚 15 Programs — Basics to Advanced
#Program TitleLevelCBSE Unit
1Add Elements of Two ListsBasicUnit 3 — Advance Python
2Arithmetic Operations on Lists (Sub, Mul, Div)BasicUnit 3 — Advance Python
3Mean, Median & Mode using NumPyBasicUnit 4 — Data Science
4Standard Deviation & Variance using NumPyBasicUnit 4 — Data Science
5Line Chart — (2,5) to (9,10)BasicUnit 4 — Data Science
6Scatter Chart — 5 PointsBasicUnit 4 — Data Science
7Bar Chart — Student MarksIntermediateUnit 4 — Data Science
8Pie Chart — Subject SurveyIntermediateUnit 4 — Data Science
9Read CSV & Display 10 RowsIntermediateUnit 4 — Data Science
10Read CSV — Info & Descriptive StatisticsIntermediateUnit 4 — Data Science
11Data Cleaning — Handle Missing ValuesIntermediateUnit 4 — Data Science
12Read & Display Image using Python (PIL)IntermediateUnit 5 — Computer Vision
13Identify Image Shape & PropertiesIntermediateUnit 5 — Computer Vision
14Multi-Chart Dashboard from CSV DataAdvancedUnit 4 — Data Science
15Mini Data Story — Full Analysis PipelineAdvancedUnit 4 + Unit 2 (AI Project Cycle)

📥 All 15 programs with full code, expected output, theory and viva questions are available in the free PDF.

⬇️ Download Free PDF Now
🐍 Python Programs — Code & Output
1

Add Elements of Two Lists

Basic
Aim: Write a Python program to add the elements of two lists. (Official CBSE Suggested Program)

A list is Python's most versatile data structure. Adding two lists element-by-element is a foundational operation in Data Science — it mimics vector addition used in NumPy and ML algorithms.

💻 Code
program1.py
# Program 1: Add elements of two lists
list1 = [10, 20, 30, 40, 50]
list2 = [5,  15, 25, 35, 45]

result = []
for i in range(len(list1)):
    result.append(list1[i] + list2[i])

print('List 1 :', list1)
print('List 2 :', list2)
print('Sum    :', result)
📤 Output
List 1 : [10, 20, 30, 40, 50]
List 2 : [5, 15, 25, 35, 45]
Sum    : [15, 35, 55, 75, 95]
✅ The program successfully adds corresponding elements of two lists using a for loop.
3

Mean, Median & Mode using NumPy

Basic
Aim: Write a program to calculate mean, median and mode using Numpy. (Official CBSE Suggested Program)

These are the three measures of central tendency in statistics — essential for Unit 4 (Data Science). Mean = average; Median = middle value; Mode = most frequent value. NumPy provides fast, vectorized calculations on datasets.

💻 Code
program3.py
# Program 3: Mean, Median and Mode using NumPy
import numpy as np
from scipy import stats

data = [12, 15, 14, 10, 18, 14, 20, 14, 11, 16]

mean   = np.mean(data)
median = np.median(data)
mode   = stats.mode(data, keepdims=True)

print('Data   :', data)
print('Mean   :', mean)
print('Median :', median)
print('Mode   :', mode.mode[0],
      '  (appears', mode.count[0], 'times)')
📤 Output
Data   : [12, 15, 14, 10, 18, 14, 20, 14, 11, 16]
Mean   : 14.4
Median : 14.0
Mode   : 14   (appears 3 times)
✅ Mean, Median and Mode calculated successfully using NumPy and SciPy.
5

Line Chart — (2,5) to (9,10)

Basic
Aim: Write a program to display line chart from (2,5) to (9,10). (Official CBSE Suggested Program)

A line chart visualises trends by connecting data points. Matplotlib's plt.plot() is the standard function. Used in Data Exploration (Unit 4) to visualise patterns across continuous data.

💻 Code
program5.py
# Program 5: Line Chart from (2,5) to (9,10)
import matplotlib.pyplot as plt

x = [2, 9]
y = [5, 10]

plt.figure(figsize=(6, 4))
plt.plot(x, y, color='blue', linewidth=2,
         marker='o', markersize=8, label='Line')
plt.title('Line Chart: (2,5) to (9,10)')
plt.xlabel('X - Axis')
plt.ylabel('Y - Axis')
plt.grid(True, linestyle='--', alpha=0.6)
plt.legend()
plt.tight_layout()
plt.show()
📤 Output
A line chart is displayed connecting (2,5) to (9,10)
with circular markers at each point, grid, title and legend.
✅ Line chart displayed successfully using Matplotlib with proper labels, grid and title.
6

Scatter Chart — 5 Points

Basic
Aim: Display a scatter chart for points (2,5), (9,10), (8,3), (5,7), (6,18). (Official CBSE Suggested Program)

A scatter chart plots individual data points on an X-Y plane to show patterns, clusters, or correlations — a fundamental technique in Data Exploration and Machine Learning.

💻 Code
program6.py
# Program 6: Scatter Chart
import matplotlib.pyplot as plt

x = [2, 9, 8, 5, 6]
y = [5, 10, 3, 7, 18]

plt.figure(figsize=(6, 4))
plt.scatter(x, y, color='red', s=100,
            edgecolors='black', linewidths=1)

for i in range(len(x)):
    plt.annotate(f'({x[i]},{y[i]})', (x[i], y[i]),
                 textcoords='offset points',
                 xytext=(6,6), fontsize=8)

plt.title('Scatter Chart')
plt.xlabel('X - Axis')
plt.ylabel('Y - Axis')
plt.grid(True, linestyle='--', alpha=0.5)
plt.tight_layout()
plt.show()
📤 Output
Scatter chart with 5 red annotated points:
(2,5)  (9,10)  (8,3)  (5,7)  (6,18)
✅ Scatter chart displayed with annotated coordinates using Matplotlib.
9

Read CSV & Display 10 Rows

Intermediate
Aim: Read csv file saved in your system and display 10 rows. (Official CBSE Suggested Program)

Reading a CSV file is the very first step in any Data Science project. Pandas' read_csv() loads the data into a DataFrame and head(10) previews the first 10 rows — Step 1 of the AI Project Cycle (Data Acquisition).

💻 Code
program9.py
# Program 9: Read CSV and display 10 rows
import pandas as pd

# Replace 'data.csv' with your actual file path
df = pd.read_csv('data.csv')

print('First 10 rows:')
print('=' * 50)
print(df.head(10))
print('\nShape :', df.shape)
print('Columns:', list(df.columns))
📤 Output
First 10 rows:
==================================================
   Name   Age  Marks  Grade
0  Aarav   15     85      A
1  Diya    15     92      A
2  Rohan   14     78      B
...  (10 rows total)

Shape  : (50, 4)
Columns: ['Name', 'Age', 'Marks', 'Grade']
✅ CSV file read and first 10 rows displayed using pandas head() function.
10

Read CSV — Display its Information

Intermediate
Aim: Read csv file saved in your system and display its information. (Official CBSE Suggested Program)

df.info() shows column names, data types and null value counts. df.describe() gives statistical summary. These are critical for Data Exploration — Step 3 of the CBSE AI Project Cycle.

💻 Code
program10.py
# Program 10: CSV Information and Statistics
import pandas as pd

df = pd.read_csv('data.csv')

print('--- Dataset Information ---')
print(df.info())

print('\n--- Descriptive Statistics ---')
print(df.describe())

print('\n--- Missing Values ---')
print(df.isnull().sum())

print('\n--- Data Types ---')
print(df.dtypes)
📤 Output
--- Dataset Information ---
RangeIndex: 50 entries
Columns: Name, Age, Marks, Grade (4 columns)

--- Descriptive Statistics ---
        Age    Marks
mean  14.80    75.40
std    0.40    12.30
min   14.00    45.00
max   15.00    99.00

--- Missing Values ---
Marks    2 | Grade   0 | Name   0
✅ Dataset info, statistics, missing values and data types displayed successfully.
12

Read & Display Image using Python

Intermediate
Aim: Write a program to read an image and display using Python. (Official CBSE Suggested Program)

Images are a key data type in Computer Vision (Unit 5). Pillow (PIL) reads image files and Matplotlib displays them. Every image is a 3D NumPy array of pixel values (Height × Width × Channels).

💻 Code
program12.py
# Program 12: Read and Display Image
from PIL import Image
import matplotlib.pyplot as plt

# Replace 'image.jpg' with your image file path
img = Image.open('image.jpg')

plt.figure(figsize=(6, 5))
plt.imshow(img)
plt.title('Displayed Image')
plt.axis('off')
plt.tight_layout()
plt.show()

print('Format :', img.format)
print('Mode   :', img.mode)
print('Size   :', img.size)
📤 Output
Image is displayed in Matplotlib window.

Format : JPEG
Mode   : RGB
Size   : (1920, 1080)
✅ Image read and displayed successfully using Pillow and Matplotlib.
13

Identify Image Shape using Python

Intermediate
Aim: Write a program to read an image and identify its shape using Python. (Official CBSE Suggested Program)

An image in Python is a NumPy array. The shape property gives (Height, Width, Channels). For RGB images, Channels = 3. For Grayscale, Channels = 1. This is the foundation of Computer Vision in Unit 5.

💻 Code
program13.py
# Program 13: Identify Image Shape
from PIL import Image
import numpy as np

img = Image.open('image.jpg')
arr = np.array(img)

print('Image Shape (H×W×C) :', arr.shape)
print('Height in pixels    :', arr.shape[0])
print('Width  in pixels    :', arr.shape[1])
print('Number of Channels  :', arr.shape[2])
print('Total Pixels        :', arr.shape[0] * arr.shape[1])
print('Data Type           :', arr.dtype)
print('Min Pixel Value     :', arr.min())
print('Max Pixel Value     :', arr.max())
📤 Output
Image Shape (H×W×C) : (1080, 1920, 3)
Height in pixels    : 1080
Width  in pixels    : 1920
Number of Channels  : 3
Total Pixels        : 2073600
Data Type           : uint8
Min Pixel Value     : 0
Max Pixel Value     : 255
✅ Image shape and all pixel properties identified successfully using NumPy.
📌 Programs 2, 4, 7, 8, 11, 14, 15 with full code and output are included in the PDF. Download it free below!

📥 Download Complete Practical File

All 15 Programs · Aim · Code · Expected Output · Theory · Viva Questions · Marking Scheme · Jupyter Guide

⬇️ Download Free PDF — Google Drive

Class10_AI_Practical_File_2025-26.pdf · Free · No login required

🎓 Important Viva Questions
1. What is a list in Python? How is it different from a tuple?Lists
2. What is NumPy? Why is it used in Data Science?NumPy
3. What is the difference between mean and median? When is each used?Statistics
4. What does Standard Deviation tell us about a dataset?Statistics
5. What is the difference between a line chart and a scatter chart?Matplotlib
6. What is the difference between a bar chart and a histogram?Matplotlib
7. What is a DataFrame? How is it different from a Python list?Pandas
8. What does df.head(10) return? What does df.info() show?Pandas
9. What is a missing value (NaN)? How do you handle it?Pandas
10. What is Pillow (PIL)? Name one function from Pillow.PIL
11. What does arr.shape return for a colour (RGB) image?PIL / NumPy
12. What is the difference between an RGB image and a Grayscale image?Computer Vision
13. What are the 5 stages of the CBSE AI Project Cycle?AI Project Cycle
14. What is the purpose of data cleaning in AI? Name one technique.Data Science
15. What is Jupyter Notebook? How do you run a cell?Jupyter
🚀 Suggested Projects (Part D — 10 Marks)
As per the official CBSE syllabus, Part D requires any one of the following. Relate it to Sustainable Development Goals (SDGs).
Sample Project 1
🎓 Student Marks Prediction Model
Build a model to predict student performance using study hours. Covers AI Project Cycle — Problem Scoping, Data Collection, Modelling, Evaluation.
Sample Project 2
🔥 CNN Model — Smoke & Fire Detection
Computer Vision project using CNN to detect fire/smoke. Relates to SDG 11 (Sustainable Cities) and SDG 13 (Climate Action).
Field Work Option
🌐 AI for Youth / AI Fest
Participate in AI Bootcamp, AI Fests, Hackathons, CBSE competitions or virtual company tours. Document in Portfolio.

Comments

Chat on WhatsApp