ARTIFICIAL INTELLIGENCE
Python Practical File
Class: X
Subject: Artificial Intelligence (417)
Student Name: ______________________
Roll No: ______________________
School Name: ______________________
Session: 2025–26
Submitted to: ______________________
CERTIFICATE
This is to certify that ______________________ of Class X has successfully completed the Python
Practical File of Artificial Intelligence (417) as prescribed by CBSE for the academic session
2025–26. The work submitted is original and completed under my guidance.
Teacher’s Signature: _____________
Date: _____________
School Seal:
INDEX
[Link] Program Title Page No
1 Python Program 1
2 Python Program 2
3 Python Program 3
4 Python Program 4
5 Python Program 5
6 Python Program 6
7 Python Program 7
8 Python Program 8
9 Python Program 9
10 Python Program 10
11 Python Program 11
12 Python Program 12
13 Python Program 13
14 Python Program 14
15 Python Program 15
Program 1: Welcome Message
Code:
print('Welcome to Artificial Intelligence')
Output:
Welcome to Artificial Intelligence
Program 2: Greeting User
Code:
name = input('Enter your name: ')
print('Hello', name)
Output:
Hello Amit
Program 3: Square of a Number
Code:
n = int(input('Enter a number: '))
print('Square =', n*n)
Output:
Square = 25
Program 4: Even or Odd
Code:
n = int(input('Enter a number: '))
if n % 2 == 0:
print('Even')
else:
print('Odd')
Output:
Odd
Program 5: Maximum of Two Numbers
Code:
a = int(input('Enter first number: '))
b = int(input('Enter second number: '))
print('Maximum =', max(a, b))
Output:
Maximum = 20
Program 6: Average of Three Numbers
Code:
a,b,c = 10,20,30
print('Average =', (a+b+c)/3)
Output:
Average = 20.0
Program 7: 1 to 10 using Loop
Code:
for i in range(1,11):
print(i)
Output:
1 2 3 4 5 6 7 8 9 10
Program 8: Sum of List
Code:
lst = [1,2,3,4,5]
print('Sum =', sum(lst))
Output:
Sum = 15
Program 9: Frequency of Element
Code:
lst = [1,2,2,3,2]
print([Link](2))
Output:
3
Program 10: Prime Number
Code:
n = 7
for i in range(2,n):
if n%i==0:
print('Not Prime')
break
else:
print('Prime')
Output:
Prime
Program 11: Simple Chatbot
Code:
msg = input('Say hi: ')
if [Link]()=='hi':
print('Hello!')
else:
print('Sorry')
Output:
Hello!
Program 12: Grade System
Code:
marks = 85
if marks>=90:
print('A')
elif marks>=60:
print('B')
else:
print('C')
Output:
B
Program 13: Dictionary
Code:
student={'Name':'Ravi','Marks':88}
print(student)
Output:
{'Name': 'Ravi', 'Marks': 88}
Program 14: Sort List
Code:
lst=[4,2,5,1]
[Link]()
print(lst)
Output:
[1, 2, 4, 5]
Program 15: AI Decision (Weather)
Code:
weather='rainy'
if weather=='rainy':
print('Take umbrella')
else:
print('Enjoy day')
Output:
Take umbrella