0% found this document useful (0 votes)
7 views4 pages

Program List 9

Uploaded by

namita8307rai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Program List 9

Uploaded by

namita8307rai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Subject : Artificial Intelligence(417)

Python Program List for Class 9

1. Write a program to input radius of a circle and find area and perimeter.
#program to input radius of a circle and find area and perimeter
rad=float(input('Enter radius of circle:-'))
area=3.14*rad*rad
peri=2*3.14*rad
print('Area of circle = ',area)
print('Perimeter of circle = ',peri)
2. Write a program to input principle amount, rate of interest and time in years and
calculate and print Simple Interest. Foumula - si=p*r*t/100
p=float(input('Enter principle amount:-'))
r=float(input('Enter Rate of interest:-'))
t=float(input('Enter time in years:-'))
si=(p*r*t)/100
print('Simple Interest = ',si)
3. Write a program to calculate percent profit based on Cost Price ad Selling Price input
by the user. Formula- pp=(sp-cp)/cp*100
cp=float(input('Enter cost price:-'))
sp=float(input('Enter selling price:-'))
pp=(sp-cp)/cp*100
print('Percent Profit is ',pp)
4. Write a program to input marks of five subjects. Calculate and print Total marks and
Percentage of Marks.
eng=float(input('Enter Marks in English out of 100:-'))
math=float(input('Enter Marks in Maths out of 100:-'))
sst=float(input('Enter Marks in S. St. out of 100:-'))
sc=float(input('Enter Marks in Science out of 100:-'))
hin=float(input('Enter Marks in Hindi out of 100:-'))
tot=eng+math+sst+sc+hin
per=tot/500*100
print('Total Marks = ',tot)
print('Percentage of Marks = ',per)
5. Write a program to input temperature in Celsius and convert it into equivalent
Fahrenheit. Formula - c=1.8*c+32
cel=float(input('Enter temperature in Degree Celsius:-'))
fah=1.8*cel+32
print('Equivalent fahrenheit temperature is :-',fah)
6. Write a program to input initial velocity, Acceleration and Time in seconds and
calculate Final Velocity. Formula - v=u+at
#calculating final velocity
u=float(input('Enter initial velocity:--'))
a=float(input('Enter acceleration:--'))
t=float(input('Enter time :--'))
v=u+a*t
print('Final Velocity = ',v)
7. Write a program to input a player’s no. of sixes, no. of fours, no. of threes, no. of twos,
no. of ones and calculate total run scored by player.
r6=int(input('Enter total number of sixes:--'))
r4=int(input('Enter total number of fours:--'))
r3=int(input('Enter total number of threes:--'))
r2=int(input('Enter total number of twos:--'))
r1=int(input('Enter total number of ones:--'))
tr=r6*6+r4*4+r3*3+r2*2+r1
print('Total runs scored by player = ',tr)
8. Write a program to input height of a person in centimeter and print it in meter and
centimeter. Eg. 174cm means 1 meter 74 centimeter.
cm=float(input('Enter your height in cm :--'))
m=cm//100
cm=cm%100
print('Your height is ',m,' m and ',cm,' cm')
9. Write a program to input Length and Breadth of a rectangle calculate and print Area
and perimeter.
L=float(input('Enter length of rectangle :--'))
B=float(input('Enter breadth of rectangle :--'))
area=L*B
peri=2*(L+B)
print('Area of rectangle =',area)
print('Perimeter of rectangle =',peri)
10. Write a program to input principle amount, rate of interest and time in years and
calculate and print Compound Interest. Formula- ci=p*(1+r/100)^t-p
#calculating compound interest
p=float(input('Enter Principle amount:--'))
r=float(input('Enter rate of interest:--'))
t=float(input('Enter time in yaers:--'))
ci=p*(1+r/100)**t-p
print('Compound Interest = ',ci)
11. WAP program to Greater between two given numbers.
#Write a program to Greater between two given numbers.
a=float(input('Enter first value:-'))
b=float(input('Enter secnd value:-'))
if a>b:
print(a,' is greater')
if b>a:
print(b,' is greater')
if a==b:
print('Both are equal')
12. WAP program to Check whether the given number is Even or Odd?
n=int(input('Enter any integer:-'))
if n%2==0:
print(n,' is Even')
else:
print(n,' is Odd')
13. WAP program to check whether the given number is neutral, positive or negative?
n=float(input('Enter any number:-'))+
if n<0:
print(n,' is negative')
if n>0:
print(n,' is positive')
if n==0:
print(n,' is neutral')
14. WAP program to Check whether the given year is Leap or not?
year=int(input('Enter aby year:-'))
if year%4==0:
print('Its a leap year')
else:
print('Its not a leap year')
15. WAP program to find grade of a student on the given percentage of marks. Grade
Criteria is-
Per>90 Grade is A+, Per>80 Grade is A, Per>70 Grade is B+, Per>60 Grade is B, Per>50
Grade is C, Per>40 Grade is D, Per>33 Grade is E.
per=float(input('Enter your percentage marks:-'))
if per>90:
print('Your Grade is A+')
elif per>80 and per<=90:
print('Your Grade is A')
elif per>70 and per<=80:
print('Your Grade is B+')
elif per>60 and per<=70:
print('Your Grade is B')
elif per >50 and per<=60:
print('Your Grade is C')
elif per>40 and per<=50:
print('Your Grade is D')
else:
print('Your Grade is E')

You might also like