AI PYTHON
PROGRAMS
Submitted By : D a k s h K u m a r
Class: 10B
Roll No: 33
Submitted To : M r s . Priyanka Ahlawat
2
ACKNOWLEDGMENT
I would like to express my sincere gratitude to everyone who supported a n d guided m e during the
completion of my AI project file, which includes 11 basic Python codes.
First a n d foremost, I a m immensely thankful to my teacher, Ms. Priyanka Ahlawat, for her valuable
guidance a n d encouragement throughout this project. Her insights motivated m e to d e e p e n my
understanding of Python programming a n d its applications in AI.
I would also like to acknowledge my own dedication a n d effort in creating this project file. This
journey has been a n invaluable learning experience, allowing m e to explore the fundamentals of
Python programming a n d enhance my skills.
Lastly, I a m thankful to my school, Kendriya Vidyalaya Dwarka Sector 5, for providing the resources a n d
environment necessary for this endeavor.
This project is a result of my hard work a n d passion for learning, a n d I a m proud to present it as a
testament to my growth in the field of programming. Thank
you!
Student’s sign -.................. Teacher’s sign - … … … … … … … . .
INDEX
▶ Program to print addition of two numbers
▶ Program to find Greater number in two numbers
▶ Program to print even or odd number
▶ Program to show the marks of all the subjects and find that student is pass or fail
▶ Program to print Area of triangle
▶ Program to print area of square
▶ Program to print area of circle
▶ Program to print simple interest
▶ Program in python to calculate compound interest
▶ Program to check number is Armstrong or not
▶ Program to check the value of factorial
WRITE A PROGRAM TO PRINT ADDITION OF TWO NUMBERS
a = int(input("enter first number "))
b = int(input("enter second number "))
sum = a + b
print(sum)
5
WRITE A PROGRAM TO FIND GREATER NUMBER IN TWO
NUMBERS.
a = int(input("Enter the first number: "))
b = int(input("Enter the second number: "))
if(a > b):
print(a, "is greater")
ealse:
print(b, "is greater")
6
WRITE A PROGRAM TO PRINT EVEN OR ODD NUMBER.
num = int(input("enter a number:"))
if (num%2)==0:
print ("the number is even")
else:
print("the number is odd")
7
WRITE A PROGRAM TO SHOW THE MARKS OF ALL THE SUBJECTS
eng=int(input("enter marks of english :"))
hindi=int(input("enter marks of hindi :"))
maths=int(input("enter marks of maths :"))
science=int(input("enter marks of science :"))
sst=int(input("enter marks of sst :"))
ai=int(input("enter marks of ai :"))
marks=(eng+hindi+maths+science+sst+ai)/6
if marks>50:
print("pass")
else:
print("fail")
8
WRITE A PROGRAM TO PRINT AREA OF TRIANGLE.
h=int(input("enter the value of
height:"))
b=int(input("enter the value of base:"))
a= 1/2*b*h
print("area of the given triangle is:", a)
9
WRITE A PROGRAM TO PRINT AREA OF SQUARE.
a=int(input("enter length in cm"))
x=a*a
print("your area of square is:", x)
10
WRITE A PROGRAM TO PRINT AREA OF CIRCLE.
r=int(input("enter your radius"))
a=3.14*(r*r)
print("your area is:", a)
11
WRITE A PROGRAM TO PRINT SIMPLE INTEREST.
P =int(input("Enter the principal amount
:"))
T = int(input("Enter the time period :"))
R = int(input("Enter the rate of interest
:"))
si = (P * T * R)/100
print ('The Simple Interest is', si)
12
WRITE A PROGRAM TO CALCULATE COMPOUND INTEREST.
p = int(input("Enter the
Principal Amount"))
r = int(input("Enter the Rate interest
per annum"))
t = int(input("Enter the time in
years")) ci=p*(pow((1+r/100),t))
print(ci)
WRITE A PROGRAM TO CHECK NUMBER IS ARMSTRONG OR NOT.
num=int(input("enter a number:"))
sum=0 temp=num
while temp>0:
digit=temp>10
sum+=digit**3
temp//=10
if num==sum:
print(num, " is an armstrong")
else:
print(num, "is not an armstrong")
THANK YOU