0% found this document useful (0 votes)
17 views

ai file

ANMS

Uploaded by

Aayan Ahmed
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)
17 views

ai file

ANMS

Uploaded by

Aayan Ahmed
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/ 30

CENTRAL BOARD OF SECONDARY EDUCATION

School Name : DPS Mathura Road

PRACTICAL RECORD FILE


CLASS X
ARTIFICIAL INTELLIGENCE

SESSION 2024-25

SUBMITTED BY:

NAME :

CLASS :
ACKNOWLEDGEMENT

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

teacher Monika Sethi for her invaluable help, advice and guidance in the

preparation of this project.

I am also greatly indebted to our Principal -Mr. Ram Singh 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.

[Name of Student]
CERTIFICATE

This is to certify that , a student of Class X, DPS Mathura


Road 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.

Internal Examiner Signature

Date:
CONTENTS

S.no Practical Date Signature


1
2
3
4
5
6

8
9
10
11
12
13
14
15
16
17
18
19
20

21

22
23
24

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 second number"))
z=int(input("enter third 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 to 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

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 to input 4 digits number and print Sum of Digits Ex-> 1234 to 10

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


sum=0while(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 isPalindrome")
else:
print("String is 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 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. WAP to find 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 to 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]

import 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:”,statistics.mean(l))
print("Mode Value:",statistics.mode(l))
print("Median Value:",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