St Clare’s Sr. Sec.
School, Agra Cantt
Class: X
Artificial Intelligence Practical File
Session 2025-2026
Coding :
1. p=int(input('Enter the principal amount'))
r=int(input('Enter the rate of interest'))
t=int(input('Enter the time period'))
interest = p*t*r/100
amt=p+interest
print('Total Interest is: ',interest)
print('Total amount is: ',amt)
2. eng=int(input('Enter the marks obtained in English'))
maths=int(input('Enter the marks obtained in Maths'))
sci=int(input('Enter the marks obtained in Science'))
hin=int(input('Enter the marks obtained in Hindi'))
ai=int(input('Enter the marks obtained in Artificial Intelligence'))
total= eng+maths+sci+hin+ai
avg=total/5
per=total*100/250
print('The average marks scored are: ',avg)
print('The percentage is: ',per)
3. side=int(input('Enter the length of the side of square'))
l=int(input('Enter the length of rectangle'))
b=int(input('Enter the breadth of rectangle'))
Area_sq= side*side
Per_sq= 4*side
print('Area of the square is: ',Area_sq)
print('Perimeter of the square is: ',Per_sq)
Area_rec= l*b
Per_rec= 4*(l+b)
print('Area of the rectangle is: ',Area_rec)
print('Perimeter of the rectangle is: ',Per_rec)
4. a= int(input('Enter a number'))
b= int(input('Enter another number'))
print('Value of first variable is:' , a)
print('Value of second variable is:' , b)
c= a
a=b
b=c
print(' After swapping :')
print('Value of first variable is:' , a)
print('Value of second variable is:' , b)
5. age=int(input('Enter the age'))
if age>=18:
print('You are able to vote')
else:
print('You are not able to vote')
6. n=int(input('Enter any number'))
if n%2 = = 0:
print('The number you have entered is even')
else:
print('You have entered an odd number')
7. sp=int(input('Enter the Selling Price of the product'))
cp=int(input('Enter the Cost Price of the product'))
if sp > cp:
profit = sp-cp
print('The profit is: ', profit)
else:
loss = cp-sp
print('The loss is: ',loss)
8. n=int(input('Enter the number'))
if n== 0:
print('The number you have entered is zero')
elif n>0:
print('The number is positive')
else:
print('The number is negative')
9. per = int(input('Enter the marks obtained'))
if per >= 90:
print('Excellent')
elif per >= 80:
print('Very Good')
elif per >= 60:
print('Good')
elif per >= 33:
print('Satisfactory')
else:
print('Needs Improvement')
10. price = int(input('Enter the mrp of the product'))
if price >= 80000:
d= 25/100
elif price >= 50000:
d= 20/100
elif price >= 25000:
d= 12/100
else:
d=0
dis_price= d * price
total_price = price - dis_price
print('The price of the product is: ' , price)
print('The discount is: ', dis_price)
print('Total price after discount is: ', total_price)
11. for i in range(20,51, 2):
print(i)
12. n=int(input('Enter a number'))
for i in range(1,11):
print(n,'*',i,'=',n*i)
13. for i in range(1,6):
for j in range(1,i+1):
print(j, end=' ')
print()
14. sub= ['Eng', 'Hindi', 'Maths', 'Science', 'Computer']
print(sub)
sub.insert(3,'Humanities')
print(sub[2])
print(sub[0:3])
print(sub[2:5:2])
l1=['Social Science', 'IT']
sub.extend(l1)
print (sub)
15. states={'UP':'Lucknow','Odisha':'Bhuvaneshwar','Maharastra':'Bombay', 'Tamil
Nadu':'Chennai', 'Delhi':'Delhi'}
print(states)
states['Bihar']='Patna'
states['Maharastra']='Mumbai'
print(states)
16. import matplotlib.pyplot as plt
cls= ['IX', 'X', 'XI', 'XII']
stn= [130,150,105,125]
plt.plot(cls,stn)
plt.title("Strength Analysis")
plt.xlabel('Classes')
plt.ylabel('Strength')
plt.show()
17. import matplotlib.pyplot as plt
city= ['Agra', 'Indore', 'Delhi', 'Mumbai']
aqi= [86, 45, 110, 96]
plt.bar(city, aqi)
plt.title("Air Quality Index")
plt.xlabel('Cities')
plt.ylabel('AQI')
plt.show()
18. import numpy as np
d=[23,56,42,14,78,91,35,67,29,84]
mn=np.mean(d)
md=np.median(d)
print('The mean of the data specified is: ',mn)
print('The median of the data specified is: ',md)
19. # consider a csv file sample.csv saved on dekstop
import pandas as pd
df = pd.read_csv("C:\\Users\\pc\\Desktop\\sample.csv")
print(df.head(10))
20. # consider a csv file sample.csv saved on dekstop
import pandas as pd
df = pd.read_csv("C:\\Users\\pc\\Desktop\\sample.csv")
print(df.info())