0% found this document useful (0 votes)
62 views23 pages

Practical File Class 9

Uploaded by

Manansi Malhotra
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)
62 views23 pages

Practical File Class 9

Uploaded by

Manansi Malhotra
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/ 23

Swastik

Malhotra
ix- E
Artificial intelligence practical file
2024-25

IX/AI/Practical File 1
CERTIFICATE
This is to certify that Swastik Malhotra of class IX-
E, Rosary Sr. Sec. School, Delhi has successfully
completed this Python Practical File for the AISSCE
as prescribed by CBSE in the year 2024-2025.

Date: _______________

Signature

__________________

IX/AI/Practical File 2
ACKNOWLEDGEMENT

I thank my Computer teacher Mr. Palvinder Singh for


guidance and support. I also thank my principal Rev.
Fr. SavariRaj. I would also like to thank my parents
for encouraging me. Finally I would like to thank CBSE
for giving me this opportunity to undertake this
subject. It gave me immense knowledge about the
language(python)

Student Name :- Swastik Malhotra

Class and Section :- IX-E

IX/AI/Practical File 3
1. WAP TO PRINT ANY FOUR FLOWER NAMES USING PRINT
STATEMENT.

Q=‘ROSE’
W=‘SUNFLOWER’
E=‘LILY’
R=‘DAISY’
print (Q, W, E, R)

OUTPUT
ROSE SUNFLOWER LILY DAISY

IX/AI/Practical File 4
2. WAP TO FIND & PRINT THE SUM, PRODUCT & DIFFERENCE OF
ANY 2 NOS
a=int(input(“enter a number”))
b=int(input(“enter a number”))
c=a+b
d=a*b
e=a-b
print(“sum of the given numbers is “,c)
print(“product of the given numbers is “,d)
print(“difference of the given numbers is “,e)

OUTPUT

enter a number1
enter a number2
sum of the numbers is 3
product of the numbers is 2
difference of the numbers is -1

IX/AI/Practical File 5
3. WAP TO CALCULATE AND PRINT THE AREA AND PERIMETER OF
RECTANGLE.
l=int(input("enter the length of the rectangle"))
b=int(input("enter the breadth of the rectangle"))
j=l*b
q=2*l+2*b
print("perimeter of the rectangle is",q)
print("area of the rectangle is",j)

OUTPUT
enter the length of the rectangle1
enter the breadth of therectangle2
perimeter of the rectangle is 6
area of the rectangle is 2

IX/AI/Practical File 6
4. WAP TO CALCULATE & PRINT THE SQUARE & CUBE OF A NO
n= int(input("enter a number"))
s= n*n
c=n*n*n
print("square of the given number is",s)
print("cube of the given number is",c)

OUTPUT
enter a number2
square of the given number is 4
cube of the given number is 8

IX/AI/Practical File 7
5. WAP TO INPUT NO. OF DAYS AND CONVERT IT INTO YEARS,
MONTHS AND DAYS

days = int(input("Enter number of days: "))


years = days // 365
days= days % 365
months = days // 30
days = days % 30
print("Years:", years)
print("Months:", months)
print("Days:", days)

OUTPUT
Enter number of days: 1000
Years: 2
Months: 9
Days: 0

IX/AI/Practical File 8
6. WAP TO INPUT ROLL NO., NAME AND MARKS OF THREE
SUBJECTS & PRINT THE TOTAL & AVERAGE MARKS.

nm=input("enter your name")


roll=int(input("enter your roll number"))
mt=float(input("enter your maths marks"))
sc=float(input("enter your science mark"))
sst=float(input("enter your sst marks"))
tot=mt+sc+sst
av=tot/3
print("total marks are",tot)
print("average marks are",av)

OUTPUT
enter your nameArsh
enter your roll number10
enter your maths marks90
enter your science mark90
enter your sst marks90
total marks are 270.0
average marks are 90.0

IX/AI/Practical File 9
7. WAP TO INPUT NAME, AGE AND NATIONALITY OF A PERSON AND
TELL IF THE PERSON IS ELIGIBLE TO VOTE OR NOT

nm=input("enter your name")


age=int(input("enter your age"))
nat=input("enter your nationality")
if('n'=="Indian“ and age>=18):
print("you are eligible to vote")
else:
print("you are not eligible to vote")

OUTPUT
enter your name arsh
enter your age13
enter your nationality Indian
you are not eligible to vote

IX/AI/Practical File 10
8. WAP TO CHECK WHETHER THE NO. IS EVEN/ODD

a=int(input("enter a number"))
b=a%2
if(b%2==0):
print(a,"is a even number")
else:
print(a,"is a odd number")

OUTPUT
enter a number11
11 is a odd number

IX/AI/Practical File 11
9. WAP TO INPUT ROLL NO., NAME AND MARKS OF FIVE SUBJECTS
& PRINT THE TOTAL & PERCENTAGE AND GRADE

nm=input("enter your name")


roll=int(input("enter your roll number"))
eng=int(input("enter your english marks"))
sc=int(input("enter your science marks"))
mt=int(input("enter your maths marks"))
hin=int(input("enter your hindi marks"))
ssc=int(input("enter your social studies marks"))
tot=eng+sc+mt+hin+ssc
print("total marks is",tot)
per =tot/100*100
print("percentage is",per)
if per(>=90):
print(nm,"has got A grade")
elif per(>=75):
print(nm,"has got B grade")
elif per(>=60):
print(nm,"has got C grade")
elif per(>=40):
print(nm,"has got D grade")
else:
print(nm,"has got E grade")

OUTPUT
enter your name Arsh
enter your roll number10
enter your english marks100
enter your science marks100
enter your maths marks100
enter your hindi marks100
enter your social studies marks100
total marks is 500
percentage is 500.0
Arsh has got A grade

IX/AI/Practical File 12
10. WAP TO INPUT TWO NOS. AND PRINT ITS + ,-,*,/ ACCORDING TO
THE USER’S CHOICE

a=int(input("enter a number"))
b=int(input("enter a number"))
print("\t\t1.add")
print("\t\t2.subtract")
print("\t\t3.multiply")
print("\t\t4.division")
print("\t\t5'exit")
ch=int(input("enter your choice"))
if(ch==1):
print("\t\t sum is",a+b)
elif(ch==2):
print("\t\t difference is",a-b)
elif(ch==3):
print("\t\t product is",a*b)
elif(ch==4):
print("\t\t quotient is”,a/b)
else:
print("\t\t thanks for coming")

OUTPUT
enter a number10060
enter a number60
1.add
2.subtract
3.multiply
4.division
5'exit
enter your choice4
quotient is 167.6666666666666

IX/AI/Practical File 13
11.WAP TO INPUT EMP. CODE, NAME, SALES AND PRINT ITS
COMMISSION
EmpCode=input('Enter employee code')
Name=input('enter employee Name')
sales=float(input('enter sales in lakhs'))
print('For employee: ',EmpCode,' named',Name,' with sales',sales)
if sales>=10:
print('Your commission is 20%')
elif(sales>=5):
print('Your commission is 15%')
elif(sales>=2):
print('Your commission is 10%')
elif(sales>=1):
print('Your commission is 5%')
else:
print('Your commission is 2%')

OUTPUT
Enter employee code266arsh
enter employee Name Sanju
enter sales in lakhs50.0
For employee: 245 named Sanju with sales 50.0
Your commission is 20%

IX/AI/Practical File 14
12.WAP TO PRINT PATTERN USING PRINT STATEMENT
a="#"
print(a*5)
print(a*4)
print(a*3)
print(a*2)
print(a*1)
b="$"
print(b*1)
print(b*2)
print(b*3)
print(b*4)
print(b*5)

OUTPUT
#####
####
###
##
#
$
$$
$$$
$$$$
$$$$$

IX/AI/Practical File 15
13. WAP TO ACCEPT THE YEAR AND CHECK WHETHER IT IS LEAP
OR NOT
year = int(input("Enter a year: "))
if (year % 400 == 0) and (year % 100 == 0):
print(year, " is a leap year")
elif (year % 4 ==0) and (year % 100 != 0):
print(year, " is a leap year")
else:
print(year, " is not a leap year")

OUTPUT

Enter a year: 1900


1900 is not a leap year

Enter a year: 2024


2024 is a leap year

IX/AI/Practical File 16
14. WAP TO FIND THE LARGEST OF ANY 2 NOS.

a=int(input("enter a number"))
b=int(input("enter a number"))
if(a>b):
print("the largest of the two number is",a)
else:
print("the largest of the two number is",b)

OUTPUT
enter a number66
enter a number77
the largest of the two number is 77

IX/AI/Practical File 17
15. WAP TO FIND THE SMALLEST OF ANY 3 DIFFERENT NOS.
a= int(input("enter a number"))
b= int(input("enter another number "))
c= int(input("enter another number"))
if a<b and a<c:
print("the smallest of the three number is ",a)
elif b<a and b<c:
print("the smallest of the three number is ",b)
else:
print("the smallest of the three number is ",c)

OUTPUT
enter a number68
enter another number69
enter another number70
the smallest of the three number is 68

IX/AI/Practical File 18
16. WAP TO INPUT A NO. & CHECK IS IT POSITIVE/NEGATIVE.
a= int(input("enter a number"))
if a<0:
print(a, " is Negative No. “)
elif if a>0:
print(a, " is Positive No. “)
else:
print(a, " Zero “)

OUTPUT
enter a number68

68 is Positive No.

enter a number -55

-55 is Negative No.

IX/AI/Practical File 19
17. WAP TO CHECK THE GIVEN NUMBER IS OF ONE DIGITED OR
TWO DIGITED OR THREE DIGITED OR MORE THAN THREE DIGITED.

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


if n>0 and n<10:
print("One digit number")
elif n>10 and n<100:
print("Two digit number")
elif n>100 and n<1000:
print("Three digit number")
else:
print("More than three digit number")

OUTPUT
Enter any number. 78
Two digit number

IX/AI/Practical File 20
18. WAP TO CHECK THE ENTERED NUMBER IS SMALLEST 4 DIGIT
NUMBER OR NOT.

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


if n==1000:
print(n,” is smallest 4 digit no")
else:
print(n, ” is not a smallest 4 digit no")

OUTPUT
Enter any number. 787
787is not a smallest 4 digit no

IX/AI/Practical File 21
19. WAP TO CHECK THE ENTERED NUMBER IS DIVISIBLE BY 5 OR
NOT.

n = int(input("Enter a number to check:"))


if n%5==0:
print("No is divisible by 5")
else:
print("No is not divisible by 5")

OUTPUT
Enter any number. 788
No is not divisible by 5

IX/AI/Practical File 22
20. A transport company charges the fare according to following
table:
Distance Charges
1-50 8 Rs./Km
51-100 10 Rs./Km
> 100 12 Rs/Km
Ask user to enter the distance and compute the fare.

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


if distance>=1 and distance<=50:
fare = distance * 8
elif distance>=51 and distance<=100:
fare = distance * 10
elif distance>100:
fare = distance * 12
else:
print("Invalid fare")
print("The total fare is:",fare)

OUTPUT

Enter distance: 30
The total fare is: 240

IX/AI/Practical File 23

You might also like