0% found this document useful (0 votes)
16 views19 pages

Practical File Ai 24-25

This document is a practical record file for Class 10 Artificial Intelligence submitted by Aditya Bhatia at DPS Azaad Nagar for the academic session 2024-25. It includes acknowledgments, a certificate of completion, and a detailed list of programming exercises along with their implementations. The exercises cover various topics such as basic arithmetic operations, string manipulations, and data visualization using Python.

Uploaded by

Sniper Thrix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views19 pages

Practical File Ai 24-25

This document is a practical record file for Class 10 Artificial Intelligence submitted by Aditya Bhatia at DPS Azaad Nagar for the academic session 2024-25. It includes acknowledgments, a certificate of completion, and a detailed list of programming exercises along with their implementations. The exercises cover various topics such as basic arithmetic operations, string manipulations, and data visualization using Python.

Uploaded by

Sniper Thrix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

CENTRAL BOARD OF SECONDARY EDUCATION

School Name Address: DPS Azaad Nagar , Kanpur

A PRACTICAL RECORD FILE IS SUBMITTED FOR THE


ARTIFICIAL INTELLIGENCE
CLASS 10
SESSION 2024-25

SUBMITTED BY: ADITYA BHATIA


SUBJECT TEACHER (AI): Vishal Khanna
ROLL NO: [01]
ACKNOWLEDGEMENT

I wish to express my deep sense of gratitude and indebtedness to our learned

teacher Vishal Khanna, PGT (CS), [DPS Azaad Nagar] for his invaluable

help, advice and guidance in the preparation of this project.

I am also greatly indebted to our principal Mrs. Shilpa Manish and school

authorities for providing me with the facilities and requisite laboratory conditions

for making this practical file.

I also extend my thanks to a number of teachers, my classmates and friends who

helped me to complete this practical file successfully.

[ADITYA BHATIA]
CERTIFICATE

This is to certify that [ADITYA BHATIA]

, student of Class X, DPS Azaad Nagar has completed the PRACTICAL FILE

during the academic year 2024-25 towards partial fulfillment of credit for the

ARTIFICIAL INTELLIGENCE practical evaluation of 2024-25 and submitted

satisfactory report, as compiled in the following pages, under my supervision.

Total number of practical certified are :

Internal Examiner Signature External Examiner Signature

Date:

School Seal Principal Signature


CONTENTS

S.no Practical Date Signature


1 a program input two numbers and print greater number .
2 a program input three numbers and print greatest
number.
3 a program to input a percentage and print grade
4 to input a number and print number is Palindrome or not
5 input a number and print number is Armstrong or not
6 input a number and print Reverse of given number
7 input 4 digits number and print Sum of Digits
8 input a number and print Factorial of given number
9 to calculate Sum of all elements of list
10 a program that reads a string and print Reverse string
11 a program that reads a string and check whether it is a
Palindrome string or not
12
13 a program input a number and print Table of given
number
14 a program to input a number and print Factorial of given
number
15 a code to compute the n th Fibonacci number
16 HCF and LCM of two given numbers
17 a program to take a list and convert it into an array and
print (Using Numpy) import numpy as np
18 a program to develop a matrix of 3x3 with values from
11 t0 28
19
20 a Python program to plot the function y = x 2 using the
pyplot or matplotlib libraries
21 a python program to plot two or more lines with
different styles
22
23 Load Image and Give the title of image
24 a menu-driven program to calculate the mean, mode and
median for the given data
25
1. Write a program input two numbers and print greater number
. x=int(input("enter any number"))
y=int(input("enter any number"))

if(x>y):
print("x is greater")
else:
print("y is greater")

2. Write a program input three numbers and print greatest


number. x=int(input("enter any number"))
y=int(input("enter any
number")) z=int(input("enter any
number")) if((x>y)and(x>z)):
print("x is greater")
elif((y>x)and(y>z)):
print("y is greater")
else:
print("z is greater")
3. Write a program to input a percentage and print grade , according to given table .

Percentage >=95 A+
Percentage >=90 and percentage <95 A
Percentage >=80 and Percentage<90 B
Percentage >=70 and percentage<80 C
Percentage <70 D

p=int(input("enter your Percentage"))

if(p>=95):
print("A+")
elif(p>=90 and p<95):
print("A")
elif(p>=80 and p<90):
print("B")
elif(p>=70 and p<80):
print("C")
else:
print("D")
4. WAP to input a number and print number is Palindrome or not .

n=int(input("enter any number"))


rev=0
m=n
while(n>0):
a=n%10
rev=rev*10+a
n=n//10
if(m==rev):
print "Palindrome "
else:
print "Not Palindrome"

5. WAP input a number and print number is Armstrong or not .

n=int(input("enter any number"))


m=n
sum=0
while(n>0):
a=n%10
sum=sum+a*a*a
n=n//10
if sum==m :
print "Armstong"
else:
print "Not Armstrong"

6. WAP input a number and print Reverse of given number Ex->234 to 432

n=int(input("enter any number"))


rev=0
while(n>0): a=n
%10
rev=rev*10+a
n=n//10
print rev

7. WAP input 4 digits number and print Sum of Digits Ex-> 1234 to 10

n=int(input("enter any number"))


sum=0
while(n>0):
a=n%10
sum=sum+a
n=n//10
print sum

8. WAP input a number and print Factorial of given number

n=int(input("enter any Number"))


f=1
for i in range (1,n+1):
f=f*i
print "factorial is",f

9. WAP to calculate Sum of all elements of list

L=[4,7,8,9,3,4,5,89]
lenght=len(L)
sum=0
for i in range(0,lenght):
sum=sum+L[i]
print "sum all element of list",sum

======================= RESTART: C:/Python27/list1.py


=======================
sum all element of list 129
>>>

10. Write a program that reads a string and print Reverse string. Input :
‘Hello’ Output ‘olleH’.

s=input("Enter your String")


l=len(s)
for i in range(-1,-l-1,-1):
print s[i],

11. Write a program that reads a string and check whether it is a Palindrome string
or not. Input : ‘nitin’ Output : ‘yes it is palindrome’.

s=input("Enter your String")


l=len(s)
str=""
for i in range(-1,-l-1,-1):
str=str+s[i]
if(s==str):
print "String are Palindrome"
else:

print "String are not Palindrome"


12. Write a program that reads a string and count :
 Number of space in given string
 Number of Vowels in given string
 Number of words in given string
 Number of characters in given string

s=input("enter your string")


l=len(s) # number of character
x=s.split()
l1=len(x)# number of words
s1="AEIOUaeiou" #collection of Vowel
c=0
for i in range(0,l):
if(s[i] in s1):
c=c+1
sp=l1-1
print "Number of space in given string",sp
print "Number of Vowels in given string",c
print "Number of words in given string",l1
print "Number of characters in given string", l
13. Write a program input a number and print Table of given
number. n=int(input("enter any number"))
for i in range(1,11):
print(n*i)

14. Write a program to input a number and print Factorial of given number.
num = int(input("Enter a number: "))
factorial = 1
# check if the number is negative, positive or zero
if num < 0:
print("Sorry, factorial does not exist for negative numbers")
elif num == 0:
print("The factorial of 0 is 1")
else:
for i in range(1,num + 1):
factorial = factorial*i
print("The factorial of",num,"is",factorial)
15. Write a code to compute the n th Fibonacci number.

def Fib(n):
a,b = 0,1
print a,b,
for i in range(n):
c=a+b
print c,
a=b
b=c
Fib(10)

16. HCF and LCM of given two numbers


number1 = int(input("Enter
Number")) number2 =
int(input("Enter Number")) temp1 =
number1
temp2 = number2
while temp2 != 0:
t = temp2
temp2 = temp1%temp2
temp1 = t
hcf = temp1
lcm =
(number1*number2)/hcf
print("HCF =",hcf)
print("LCM =",lcm)

17. Write a program to take a list and convert it into an array and print (Using
Numpy) import numpy as np
l=[1,2,3,4]
a=np.array(l)
print("Array is :", a)
print("Multiply by 2 in Array",a*2)
print("Multiply by 2 in list",l*2)

18. Write a program to develop a matrix of 3x3 with values from 11 t0


28. #import numpy package
import numpy as np
#Creating array using arange() function
arr=np.arange(11,28,2)
#reshaping array for
2D arr=arr.reshape(3,3)
#printing array
print(arr)
19. Write a program to create a data frame to store data of candidates who appeared in
interviews. The dataframe columns are name, score, attempts, and qualify
(Yes/No). Assign rowindex as C001,C002, and so on.

import pandas as pd
#Creating Dictionary to store data d={'Name':['Anil','Bhavna','Chirag','Dhara','Giri'],'Score':
[25,20,22,23,21],'Attempts':[1,2, 2,1,1],'Qualified':['Yes','No','Yes','Yes','No']} #Creating a
dataframe
df=pd.DataFrame(d,index=['C001','C002','C003','C004','C005'])
print(df)

Name Score Attempts Qualified


C001 Anil 25 1 Yes
C002 Bhavna 20 2 No
C003 Chirag 22 2 Yes
C004 Dhara 23 1 Yes
C005 Giri 21 1 No

20. Write a Python program to plot the function y = x 2 using the pyplot or matplotlib
libraries.

import matplotlib.pyplot as pl
import numpy as np
x=np.arange(1,9)
y=x*x
pl.plot(x,y)

pl.show()
21. Write a python program to plot two or more lines with different styles.
import matplotlib.pyplot as pl
import numpy as np
val=[[5.,25.,15.,20.],[4.,23.,8.,17.],[6.,22.,47.,19.]]
x=np.arange(4)
pl.plot(x,val[0],color='b',
label='range1')
pl.plot(x,val[1],color='g',
label='range2') pl.plot(x,val[2],color='r',
label='range3') pl.legend(loc='upper
left') pl.title("multirange line chart")
pl.show()
22. Write to create a pie for sequence con=[23.4,17.8,25,34,40]
for Zones=[‘East,’West’,”North’,’South’,’Central’]
a. Show North zone’s value exploded
b. Show % contribution for each Zone.
c. The pie chart should be circular.

import matplotlib.pyplot as pl
import numpy as np
con=[23.4,17.8,25,34,40]
Zones=['East','Wast','North','South','Central']
pl.axis("equal")
pl.pie(con,labels=Zones,explode=[0,0.1,0.2,0,0],autopct="%1.1f%%")
pl.show()

23. Load Image and Give the title of image

import cv2
import matplotlib.pyplot as plt
import numpy as np
#Load the image file into memory
img = cv2.imread('dps.jpg') #Display Image
plt.imshow(img)
plt.title('DPS Azaad Nagar')
plt.axis('off')
plt.show()
24. Write a menu-driven program to calculate the mean, mode and median for the given data:
[5,6,1,3,4,5,6,2,7,8,6,5,4,6,5,1,2,3,4]
mport statistics #Creating list
l=[5,6,1,3,4,5,6,2,7,8,6,5,4,6,5,1,2,3,4]
#Display mean, mode and median value using functions
print("Mean Value:%.2f"%statistics.mean(l))
print("Mode Value:%.2f"%statistics.mode(l))
print("Median Value:%.2f"%statistics.median(l))

25. Create your own pixels on piskelapp (https://www.piskelapp.com/) and make a gif
image. Open piskelapp on your browser.
Apply background for the picture.
Use pen to draw letter A
Copy the layer and paste it
Now erase letter A written previously
Apply the background colour for layer 2
Change the pen colour and Write I
Export the image.
Follow this link to access animated GIF:
https://piskel-imgstore-b.appspot.com/img/48da25a6-5743-11ed-acee-17e8d17e27f5.gif

You might also like