Yash Yadav Project File (2) - 070431
Yash Yadav Project File (2) - 070431
BABRALA (SAMBHAL)
PRACTICAL FILE
THIS IS TO CERTIFY THAT YASH YADAV OF CLASS X BR
OF DAV FERTILIZER PUBLIC SCHOOL, BABRALA HAS
SUCCESSFULLY COMPLETED THE INVESTIGATORY
PROJECT FILE UNDER THE GUIDANCE OF Mr.
SURENDRA SINGH DURING THE SESSION 2023-2024.
IN THE PARTIAL FULFILMENT OF ARTIFICIAL
INTELLIGENCE PRACTICAL EXAMINATION CONDUCTED
BY CBSE.
-----------------------------
MR.SURENDRA SINGH
(SUBJECT TEACHER)
1|Page
S.
NO.
2|Page
I
………………………………………………..
PYTHON BASICS
………………………………………………..
PROGRAM-1- Write a program to find the sum of two number by the
user?
SOURCE CODE-
S1=int(input("WRITE THE NUMBER?"))
S2=int(input("WRITE THE OTHER NUMBER?"))
sum=(S1+S2)
print ("SO THE SUM OF THE NUMBER IS",sum)
OUTPUT-
WRITE THE NUMBER?12
WRITE THE OTHER NUMBER?34
SO THE SUM OF THE NUMBER IS 46
3|Page
PROGRAM-3- Write a List and check the number divisible by two?
SOURCE CODE-
l=[23,45,13,96,94]
for l in l:
if l%2==0:
print (l,"NUMBER IS EVEN")
else:
print (l, "NUMBER IS ODD")
OUTPUT-
23 NUMBER IS ODD
45 NUMBER IS ODD
13 NUMBER IS ODD
96 NUMBER IS EVEN
94 NUMBER IS EVEN
PROGRAM-4- Write a List and print the number with their index
number?
SOURCE CODE-
l=[22,45,67,89,6,10]
for i in range(len(l)):
print(i, l[i])
OUTPUT-
0 22
1 45
2 67
3 89
4 6
5 10
6|Page
PROGRAM-11-Write a program by taking the input by the user and
check whether he/she is eligible for driving or not?
SOURCE CODE-
age=int(input("Enter your age:-"))
if age>=18:
print("Congratulations! You are eligible for driving")
else:
print("Not elligible")
OUTPUT-
Enter your age:-19
Congratulations! You are eligible for driving
7|Page
………………………………………………..
MATPLOTLIB
………………………………………………..
PROGRAM-1-Draw the continuous bar graph showing the
intelligency level of Manessha,Rekha and Seema.
SOURCE CODE-
import matplotlib.pyplot as plt
name=['Maneesha','Rekha','Seema']
intelligency=(99,95,55)
plt.bar(name,intelligency,color='gb',width=1.6)
plt.show( )
OUTPUT-
8|Page
OUTPUT-
9|Page
OUTPUT-
10 | P a g e
OUTPUT-
11 | P a g e
OUTPUT-
12 | P a g e
OUTPUT-
13 | P a g e
OUTPUT-
14 | P a g e
………………………………………………..
NUMPY
………………………………………………..
PROGRAM-1- Write a simple program using numpy array.
SOURCE CODE-
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print(arr)
OUTPUT-
[1 2 3 4 5]
15 | P a g e
PROGRAM-4- Write a array and do indexing and slicing over it.
SOURCE CODE-
import numpy as np
arr = np.array([10, 20, 30, 40, 50])
print("Element at index 2:", arr[2])
print("Sliced array from index 1 to 3:", arr[1:4])
OUTPUT-
Element at index 2: 30
Sliced array from index 1 to 3: [20 30 40]
16 | P a g e
………………………………………………..
PANDAS
………………………………………………..
17 | P a g e
PROGRAM-3- Write the name age and grade of two students
using pandas.
SOURCE CODE-
import pandas as pd
data = {'Name': ['Alice', 'Bob', 'Charlie'],
'Age': [15, 16, 15],
'Grade': ['A', 'B', 'A']}
df = pd.DataFrame(data)
filtered_df = df[df['Grade'] == 'A']
print(filtered_df)
OUTPUT-
Name Age Grade
0 Alice 15 A
2 Charlie 15 A
18 | P a g e
………………………………………………..
COMPUTER VISION
………………………………………………..
PROGRAM-1- Write a program to load a image and give title to
the image as well.
SOURCE CODE-
import cv2
import matplotlib.pyplot as plt
import numpy as np
img = cv2.imread('Images/man.jpg')
plt.imshow(img)
plt.title('man')
plt.axis('off')
plt.show()
OUTPUT-
OUTPUT-
20 | P a g e
OUTPUT-
21 | P a g e
PROGRAM-5- Write a program to load a image and label it as per
its name.
SOURCE CODE-
import cv2
import matplotlib.pyplot as plt
import numpy as np
img = cv2.imread('Images/flower.jpg')
plt.imshow(img)
plt.title('Flower')
plt.axis('off')
plt.show()
OUTPUT-
22 | P a g e