Class X AI Practical File 2024-25
Class X AI Practical File 2024-25
PRACTICAL FILE
OF
ARTIFICIAL INTELLIGENCE (417)
CLASS: X
(Session: 2024-2025)
CBSE.
Signature of Examiner
TABLE OF CONTENTS
S.NO PROGRAM
1 Write a python program to find sum of two numbers.
4 Write a python program to find out 2 raised to power x where x is taken as input.
5 Write a program to plot a bar chart in python to display the result of a school for five
consecutive years.
6 Create multiline chart on common plot where three data range plotted on
data=[[5,25,45,20],[8,1,29,27],[9,29,27,39]]
7 A survey gathers heights and weight of 50 participates and recorded the participants
age as
Ages=[40,56,46,58,79,70,67,46,32,91,92,93,47,95,69,69,56,50,30,9,29,29,0,31,21,14,1
8,1
6,18,76,68,69,78,81,71,91,71,01,69,78,77,54,59,59,41,51,48,49,76,10]
import matplotlib.pyplot as pl
OUTPUT --
6. Create multiline chart on common plot where three data range plotted on
data=[[5,25,45,20],[8,1,29,27],[9,29,27,39]]
import numpy as np
data=[[5,25,45,20],[8,1,29,27],[9,29,27,39]]
x=np.arange(4)
plt.plot(x,data[0],color='b',label='range 1')
plt.plot(x,data[1],color='g',label='range 2')
plt.plot(x,data[2],color='r',label='range 3')
plt.legend(loc='upper left')
plt.xlabel('X')
plt.xlabel('Y')
plt.show()
OUTPUT --
7. A survey gathers heights and weight of 50 participates and recorded the participants age
as
Ages=[40,56,46,58,79,70,67,46,32,91,92,93,47,95,69,69,56,50,30,9,29,29,0,31,21,14,18,1
6,18,76,68,69,78,81,71,91,71,01,69,78,77,54,59,59,41,51,48,49,76,10]
import numpy as np
Ages=[40,56,46,58,79,70,67,46,32,91,92,93,47,95,69,69,56,50,30,90,29,29,\
45,31,21,14,18,16,18,76,68,69,78,81,71,91,71,30,69,78,77,\
54,59,59,41,51,48,49,76,10]
plt.hist(Ages,bins=10)
plt.show()
OUTPUT --
8. Draw a Square using turtle in python
9. Write a program to determine the type of an object.
Output
print("Calculator")
print("1.Add")
print("2.Substract")
print("3.Multiply")
print("4.Divide")
# input choice
ch=int(input("Enter Choice(1-4): "))
if ch==1:
a=int(input("Enter A:"))
b=int(input("Enter B:"))
c=a+b
print("Sum = ",c)
elif ch==2:
a=int(input("Enter A:"))
b=int(input("Enter B:"))
c=a-b
print("Difference = ",c)
elif ch==3:
a=int(input("Enter A:"))
b=int(input("Enter B:"))
c=a*b
print("Product = ",c)
elif ch==4:
a=int(input("Enter A:"))
b=int(input("Enter B:"))
c=a/b
print("Quotient = ",c)
else:
print("Invalid Choice")
OUTPUT
Calculator
1.Add
2.Substract
3.Multiply
4.Divide
Enter Choice(1-4): 3
Enter A:10
Enter B:20
Product = 200