AI Record 2024
AI Record 2024
Pottore,Thrissur–680581
ARTIFICIAL INTELLIGENCE
PRACTICAL & PROJECT RECORD
CLASS X
Certified that this is a Bonafide Record of the Practicals and Project
Work of Master/Kumari.......................................................................
Teacher-in-charge Principal
Date: .......................
1
INDEX
Sl No Date Title Page No.
1 04-06-2024 To concatenate two strings 3
To check whether a given number is odd
2 04-06-2024 4
or even
Menu driven program to perform the
3 11-06-2024 5
four basic arithmetic operations
4 11-06-2024 To print natural numbers up to n 6
2
04-06-2024
PROGRAM
OUTPUT
Enter your first name: Arjun
Enter your second name: Pandey
Your actual name is : Arjun Pandey
1
04-06-2024
PROGRAM
OUTPUT
Enter a number: 15
15 is odd
4
11-06-2024
PROGRAM
print("1.Add")
print("2.Subtract")
print("3.Multiply")
print("4.Divide")
choice=int(input("Enter your choice(1-4): "))
if choice >=1 and choice <=4:
a=int(input("Enter a number: "))
b=int(input("Enter a number: "))
if choice==1:
s=a+b
print("sum =", s)
elif choice==2:
d=a-b
print("Difference =", d)
elif choice==3:
p=a*b
print("Product =", p)
elif choice == 4:
q=a/b
print("Quotient =", q)
else:
print("Invalid choice!")
OUTPUT
1.Add
2.Subtract
3.Multiply
4.Divide
Enter your choice(1-4): 1
Enter a number: 40
Enter a number: 50
sum = 90
5
11-06-2024
PROGRAM
OUTPUT
Enter a number: 10
1
2
3
4
5
6
7
8
9
10
6
18-06-2024
PROGRAM
OUTPUT
Enter a number: 5
5x1=5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50
7
09-07-2024
PROGRAM
OUTPUT
Enter a number: 7
7 is prime
8
27-08-2024
PROGRAM
OUTPUT
9
08-10-2024
PROGRAM
speed=[100,99,99,98,96,95,100,98,89,99,97,95,100,99,99,98]
#speed is a list to store the speed of vehicles
x=np.mean(speed)
y=np.median(speed)
z=stat.mode(speed)
print ("Mean =", x)
print("Median =", y)
print("Mode =", z)
OUTPUT
Mean = 97.5625
Median = 98.5
Mode = 99
10
15-10-2024
plt.xlabel("X Axis") #to give "X axis" as the label for X axis
plt.ylabel("Y Axis") #to give "Y axis" as the label for Y axis
OUTPUT
11
22-10-2024
12
29-10-2024
13
#12. Write a program to read student.csv file saved in your system
and display first 5 rows
PROGRAM
OUTPUT
14
05-11-2024
PROGRAM
import pandas as pd
dataframe = pd.read_csv("c:/AI_10/student_performance.csv")
dataframe.head(10) #head(10) to display first 5 rows of csv file
OUTPUT
15
12-11-2024
PROGRAM
plt.show()
OUTPUT
16
19-11-2024
#15. Write a program to read and display an image and identify its
shape using Python.
PROGRAM
import cv2
import matplotlib.pyplot as plt
img = cv2.imread('c:/AI_10\original_man.jpg')
plt.imshow(img)
plt.title('Man')
plt.axis('off')
plt.show()
print(img.shape) #to display the height, width and no of channels
OUTPUT
17
#16. Write a program to read an image and display it in grayscale.
PROGRAM
import cv2
import matplotlib.pyplot as plt
img = cv2.imread('c:/AI_10\original_man.jpg',0)
#to read the image in grayscale
plt.title('Man')
plt.axis('off')
plt.show()
OUTPUT
18
ARTIFICIAL
INTELLIGENCE
19