ai file
ai file
SESSION 2024-25
SUBMITTED BY:
NAME :
CLASS :
ACKNOWLEDGEMENT
teacher Monika Sethi for her invaluable help, advice and guidance in the
I am also greatly indebted to our Principal -Mr. Ram Singh and school
[Name of Student]
CERTIFICATE
Date:
CONTENTS
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 .
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
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 .
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)
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
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)
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]
https://piskel-imgstore-b.appspot.com/img/48da25a6-5743-11ed-acee-17e8d17e27f5.gif