0% found this document useful (0 votes)
36 views16 pages

Divyaansh Arora 10112 X-A

Uploaded by

divyaansh.arora
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)
36 views16 pages

Divyaansh Arora 10112 X-A

Uploaded by

divyaansh.arora
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/ 16

SACHDEVA GLOBAL SCHOOL

Sector-18, Dwarka,New Delhi-110078

Artificial Intelligence
Practical File

Submitted By -
Class- X-A
Session- 2025-26

Class Roll No: 10112


CERTIFICATE

This is to certify that Divyaansh Arora of X-A has prepared this AI FILE. This
practical file is the result of his/her individual efforts & endeavours.

INTERNAL EXAMINER
(Ms. Seema Solanki)

Signature
Table of Contents

S.No Program Date Signature


Term-I
1. Write a program to check if the entered number is a prime number or
not.
2. Write a Python program to check whether the entered character is in
Lowercase or Uppercase

3. Write a Python program to find the maximum number out of the given
three numbers entered by the user.
4. Write a Python program to accept a number from the user and print the
table of that number.
5. Write a program to display calendar of the given month and year using
calendar module.

6. Write a program to accept age from user and check whether he/she is
eligible for vote or not.

7. Create a menu based Calculator using Python.

8. Write a program in Python to input a number between 1 to 7 and print


the corresponding day of a week (day name).
9. Write a program to accept a number from user and to check whether
the entered number is even/odd number.

10. Write a program to accept radius of circle from user and find the area
of the circle using the math module.
1. Write a program to check if the entered number is a prime number or not.

n=int(input("ENter a number: "))


if n>1:
i=True
for d in range (2,n):
if n%d == 0:
i=False
if i:
print(n, "is a prime number")
else:
print(n, "is not a prime number")
else:
print(n, "is not a prime number")

2. Write a Python program to check whether the entered character is in Lowercase or Uppercase

x=input("Enter the character: ")


if x.isupper():
print(x, "is in upper case.")
elif x.islower():
print(x, "is in lower case.")
else:
print(x, "is not an Alphabet")
3. Write a Python program to find the maximum number out of the given three numbers entered by
the user.
n1=float(input(" Enter the first number : "))
n2=float(input(" Enter the second number : "))
n3=float(input(" Enter the third number : "))
if n1>=n2 and n1>=n3:
print(n1, "is the largest number")
elif n2>=n1 and n2>=n3:
print(n2, "is the largest number")
else:
print(n3, "is the largest number")
4. Write a Python program to accept a number from the user and print the table of that number.

n=float(input("The number for which table needs to be printed:"))


for i in range (1,11):
print(n, " x " , i , "=" , n*i)

5. Write a program to display calendar of the given month and year using calendar module.
import calendar as c
year=int(input("Enter year: "))
month=int(input("Enter the month number(1-12):"))
print(c.month(year, month))

6. Write a program to accept age from user and check whether he/she is eligible for vote or not.

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


if n>=18:
print ("You are eligible to vote")
else:
print ("Sorry, you are not eligible to vote. You can vote after ", 18-n , "years")
7. Create a menu based Calculator using Python.

print(" 1- Addition")
print(" 2- Subtraction")
print(" 3- Multiplication")
print(" 4- Division")

n=int(input("Choose the number corresponding to the operation you want to


be performed : "))
n1=float(input("First number:"))
n2=float(input("Second number:"))

if n==1:
a=n1+n2
print ("Your answer for", n1 , "+" , n2 , "=" , a)
elif n==2:
a=n1-n2
print ("Your answer for", n1 , "-" , n2 , "=" , a)
elif n==3:
a=n1*n2
print ("Your answer for", n1 , "*" , n2 , "=" , a)
elif n==4:
a=n1/n2
print ("Your answer for", n1 , "/" , n2 , "=" , a)
else:
print("Input Invalid")

8. Write a program in Python to input a number between 1 to 7 and print the corresponding day of
a week (day name).
n=int(input("Enter the day number (1-7) : "))
if n==1:
print("The day is Monday")
elif n==2:
print("The day is Tuesday")
elif n==3:
print("The day is Wednesday")
elif n==4:
print("The day is Thursday")
elif n==5:
print("The day is Friday")
elif n==6:
print("The day is Saturday")
elif n==7:
print("The day is Sunday")
else:
print("Input Invalid")
9. Write a program to accept a number from user and to check whether the entered number is
even/odd number.

n=int(input("Enter the number to be checked:"))


if n%2==0:
print(n, "is a even number")
elif n%2!=0:
print(n, "is a odd number")
else:
print("Input Invalid")
10. Write a program to accept radius of circle from user and find the area of the circle using the
math module.

n=int(input("Enter the radius of the circle:"))


a=n*3.14
print("The area of the circle with radius", n ,"is",a)
import statistics
s = [99,86,87,88,111,86,103,87,94,78,77,85,86]
mean=statistics.mean(s)
median=statistics.median(s)
mode=statistics.mode(s)
print("Mean is", mean)
print("Median is", median)
print("Mode is", mode)

import matplotlib.pyplot as plt

names = ["Riya", "Priya", "Ranak", "Rita"]


marks = [50, 70, 90, 70]

plt.bar(names, marks, color='skyblue')


plt.xlabel("Students")
plt.ylabel("Marks")
plt.title("Mathematics Marks of Class X Students")
plt.ylim(0, 100)
plt.grid(axis='y')
plt.show()
import matplotlib.pyplot as plt
sizes = [78, 21, 0.9, 0.04, 0.06]
labels = ['Nitrogen', 'Oxygen', 'Argon', 'Carbon Dioxide', 'Other Gases']
colors = ['green', 'yellow', 'blue', 'red', 'pink']
plt.pie(sizes, labels=labels, colors=colors)
plt.title('Composition of Earths Air')
plt.axis('equal')
plt.show()
import matplotlib.pyplot as plt
x_values = [1, 2, 3, 4, 5]
y_values = [1, 4, 9, 16, 25]
plt.plot(x_values, y_values)
plt.xlabel("Number")
plt.ylabel("Squares")
plt.title("Square-Integer Plot")
plt.show()
import matplotlib.pyplot as plt

heights = [102, 115, 123, 130, 118, 125, 110, 135, 140, 128]

plt.hist(heights, bins=5, color='blue', edgecolor='black')


plt.xlabel('Height (cm)')
plt.ylabel('Number of Children')
plt.title('Histogram of Children\'s Heights')
plt.grid(True)
plt.show()

import matplotlib.pyplot as plt

x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
y = [5, 7, 6, 8, 7, 9, 10, 12, 11, 13]

plt.scatter(x, y, color='darkorange')
plt.xlabel('Child Number')
plt.ylabel('Height (cm)')
plt.title('Scatter Plot of Children\'s Heights')
plt.grid(True)
plt.show()

You might also like