Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Central Board of Secondary Education Amity International School Sector-1, Vasundhara, Ghaziabad

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

CENTRAL BOARD OF SECONDARY EDUCATION

AMITY INTERNATIONAL SCHOOL


SECTOR-1, VASUNDHARA, GHAZIABAD

A PRACTICAL RECORD FILE IS SUBMITTED FOR THE ARTIFICIAL INTELLIGENCE


CLASS 10 SESSION 2024-25

SUBMITTED BY:
SUBJECT TEACHER(AI):
CLASS: SEC
ROLL NO:
ACKNOWLEDGEMENT

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


our learned teacher …………………………………………. ,
DESIGNATION…………………………..of ……………………………….for his
invaluable help, advice and guidance in the preparation of this
project. I am also greatly indebted to our principal
…………………………………………….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.

…………………………………..
CERTIFICATE
This is to certify that ………………………………………. , student of Class
X of ………………………………………….. has completed the PRACTICAL
FILE during the academic year ……………………………… towards
partial fulfilment 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
UNIT 3: Advanced Python
1. Write a program to compute the net run rate for a tournament.
tn=input("Enter Team name:")
n=int(input("Enter no. of matches played:"))
tr=0
to=0
tagr=0
togr=0
for i in range(n):
r=int(input("Enter runs scored in match"+str(i+1)+":"))
o=int(input("Enter overs played:"))
tr=r+tr
to=to+o
agr=int(input("Enter runs conceded in match"+str(i+1)+":"))
ogr=int(input("Enter overs bowled:"))
tagr+=agr
togr+=ogr
nrr=(tr/to)-(tagr/togr)
print("Net runrate is:",nrr)

2. Write a program to check whether the given character is an uppercase letter or


lowercase letter or a digit or a special character.
ch=input("Enter Any Character:")
if ch.isupper():
print(ch, " is an upper case letter")
elif ch.islower():
print(ch, " is a lower case letter")
elif ch.isdigit():
print(ch, " is a digit")
elif ch.isspace():
print(ch, " is a space")
else:
print(ch," is a special character")

3. Write a program to find the maximum number out of the given three numbers.
n1=int(input("Enter the Number1:"))
n2=int(input("Enter the Number2:"))
n3=int(input("Enter the Number3:"))
if n1>n2 and n1>n3:
print(n1, " - Number 1 is greater")
elif n1>n2 and n1>n3:
print(n2, " - Number 2 is greater")
elif n3>n1 and n3>n2:
print(n3, " - Number 3 is greater")
else:
print("All are same")

4. An electric power distribution company charges its domestic consumers as follows

Write a program that read the customer number & power consumed and prints the
amount to be paid by the customer. Note that output should be well formatted.
cno=int(input("Enter Cusumer Number:"))
pc=int(input("Enter power consumed:"))
if pc>0 and pc<=100:
bill_amt=pc*1
elif pc>100 and pc<=300:
bill_amt=100+(pc-100)*1.25
elif pc>300 and pc500:
bill_amt=650+(pc-500)*1.75
else:
print("Invalid Power Consumed Units")
print("~"*60)
print("\t\tABC Power Company Ltd.")
print("~"*60)
print("Consumer Number:",cno)
print("Consumed Units:",pc)
print("------------------------------")
print("Bill Amount:",bill amt)

5. Write a program to check whether the entered number is Armstrong or not


n=int(input("Enter number to check:"))
t=n
s=0
while n!=0:
r=n%10
s=s+(r**3)
n//=10
if t==s:
print(s," is Armstrong number")
else:
print(s," is not an Artmstrong number")

6. Write a program to print a multiplication table of the entered number.


n=int(input("Enter number to print multiplication table:"))
for i in range(1,11):
print(n," x ", i, " = ", n*i )

7. Write a program to generate the following pattern:

n=int(input("Enter n:"))

k=1

for i in range(1,n+1):

for j in range(1,i+1):

print(k, end=" ")

k=k+1

print()

8. Write a program to create a list of students' marks with user-defined values and
find the maximum.

n=int(input("Enter no. of subjects:"))


l=[]
for i in range(n):
m=int(input("Enter marks:"))

l.append(m)
print("Maximum marks scored:",max(l)
9. Write a program to count the frequency of every element in a given list.
l = []

n=int(input("Enter the no. of elements:"))

for i in range(n):

val=int(input("Enter value "+str(i+1)+":"))

l.append(val)

f = {}

for i in l:

if (i in f):

f[i] += 1

else:

f[i] = 1

for i, j in f.items():

print(i, "->", j)

10.Write a program to check prime number or not.


num=int(input(“enter a number: “))

If num >1:

For I in range (2,num):

If(num%i==0):

print (num,”is not a prime number”)

break

else:

print(num,”is a prime number”)

else:

print(num,”is not a prime number”)


UNIT 4: Data Science Program
11. Converting Python list into Numpy array
import numpy as np
l=[]
n=int(input("enter no of elements"))
for i in range (n):
val=int(input("enter value"+str(i+1)+":"))
l.append(val)
arr=np.array(l)
print ("Array:",arr)

12.Develop a matrix of 3*3 Array using any number range


import numpy as np
arr=np.arange(11,28,2)
arr=arr.reshape(3,3)
print(arr)
13.Calculating Mean, Median and mode
import statistics
l=[2,4,6,5,7,8,9,10,3,5,4,7,8,3,2,5,6]
print("Mean Value:%.2f"%statistics.mean(l))
print("Mode Value:%.2f"%statistics.mode(l))
print("Median Value:%.2f"%statistics.median(l))

14.Write a program to calculate variance and standard deviation for the given data:
[33,44,55,67,54,22,33,44,56,78,21,31,43,90,21,33,44,55,87]
import statistics
l=[33,44,55,67,54,22,33,44,56,78,21,31,43,90,21,33,44,55,87]
print("Variance:%.2f"%statistics.variance(l))
print("Standard Deviation:%.2f"%statistics.stdev(l))

15.Write a program to represent the data on the ratings of mobile games on bar
chart. The sample data is given as: Pubg, FreeFire, MineCraft, GTA-V, Call of
duty, FIFA 22. The rating for each game is as: 4.5,4.8,4.7,4.6,4.1,4.3.
import matplotlib.pyplot as plt
games=['Pubg', 'FreeFire', 'MineCraft', 'GTA-V','Call of duty', 'FIFA 22']
rating=[4.5,4.8,4.7,4.6,4.1,4.3]
plt.bar(games,rating,color=['black', 'red', 'green', 'blue', 'yellow'])
plt.title("Games Rating 2022")
plt.xlabel('Games')
plt.ylabel('Rating')
plt.legend()
plt.show()

16.Consider the following data of a clothes store and plot the data on the line chart:

Customize the chart as you wish.


import matplotlib.pyplot as pp
mon =['March','April','May','June','July','August']
jeans= [1500,3500,6500,6700,6000,6800]
ts = [4400,4500,5500,6000,5600,6300]
sh = [6500,5000,5800,6300,6200,4500]
pp.plot(mon,jeans,label='Mask',color='r',linestyle='dashed', linewidth=4,\
marker='o', markerfacecolor='b',
markeredgecolor='k')
pp.title("Apna Garment Store")
pp.xlabel("Months")
pp.ylabel("Garments")
pp.legend()
pp.show()

UNIT 5: Computer Vision Program

17.Visit this link (https://www.w3schools.com/colors/colors_rgb.asp). On the basis of


this online tool, try and write answers of all the below-mentioned questions.
 What is the output colour when you put R=G=B=255?
 What is the output colour when you put R=G=255,B=0?
 What is the output colour when you put R=255,G=0,B=255?
 What is the output colour when you put R=0,G=255,B=255?
 What is the output colour when you put R=G=B=0?
 What is the output colour when you Put R=0,G=0,B=255?
 What is the output colour when you Put R=255,G=0,B=0?
 What is the output colour when you put R=0,G=255,B=0?
 What is the value of your colour?
Solution
1. White
2. Yellow
3. Pink
4. Cyan
5. Black
6. Blue
7. Red
8. Green
9. R=0,G=0,B=255

18.Create your own pixels on piskelapp (https://www.piskelapp.com/) and make a gif


image.
Steps:
1. Open piskelapp on your browser.
2. Apply background for the picture.
3. Use pen to draw letter A
4. Copy the layer and paste it
5. Now erase letter A written previously
6. Apply the background colour for layer 2
7. Change the pen colour and Write I
8. Export the image.
9. Follow this link to access animated GIF: Click here

19.Do the following tasks in OpenCV.


a. Load an image and Give the title of the image
b. Change the colour of image and Change the image to grayscale
c. Print the shape of image
d. Display the maximum and minimum pixels of image
e. Crop the image and extract the part of an image
f. Save the Imag

a. Load Image and Give the title of image


#import required module cv2, matplotlib and numpy
import cv2
import matplotlib.pyplot as plt
import numpy as np
#Load the image file into memory
img = cv2.imread('octopus.png')
#Display Image
plt.imshow(img)
plt.title('Octopus')
plt.axis('off')
plt.show()

b. Change the colour of image and Change the image to grayscale


#import required module cv2, matplotlib and numpy
import cv2
import matplotlib.pyplot as plt
import numpy as np
#Load the image file into memory
img = cv2.imread('octopus.png')
#Chaning image colour image colour
plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
plt.title('Octopus')
plt.axis('off')
plt.show()

c. Print the shape of image


import cv2
img = cv2.imread('octopus.png',0)
print(img.shape)

d. Display the maximum and minimum pixels of image


import cv2
img = cv2.imread('octopus.png',0)
print(img.min())
print(img.max())

e. Crop the image and extract the part of an image


import cv2
import matplotlib.pyplot as plt
img = cv2.imread('octopus.png')
pi=img[150:400,100:200]
plt.imshow(cv2.cvtColor(pi, cv2.COLOR_BGR2RGB))
plt.title('Octopus')
plt.axis('off')
plt.show()

f. Save the Image


import cv2
import matplotlib.pyplot as plt
img = cv2.imread('octopus.png')
plt.imshow(img)
cv2.imwrite('oct.jpg',img)
plt.title('Octopus')
plt.axis('off')
plt.show()

You might also like