Python Programs for Revision
1. Write a python program to calculate and display area of circle
rad = int(input(“Enter radius:”))
area = 22/7 * rad * rad
print(area)
2. Write a python program to calculate and display area and perimeter of rectangle
len = int(input(“Enter length:”))
width = int(input(“Enter width:”))
area = len * width
perimeter = 2 * (len+width)
print(area)
print(perimeter)
3. Write a python program to calculate and display area of triangle
base = int(input(“Enter base:”))
height = int(input(“Enter height:”))
area = 1/2 * base * height
print(area)
4. Write a python program to take three subject marks, calculate and display the
average of three subjects
S1 = int(input(“Enter Math marks:”))
S2 = int(input(“Enter Science marks:”))
S3 = int(input(“Enter ICT marks:”))
Avg = (S1+S2+S3)/3
print(Avg)
5. Write a python program to calculate simple interest and total amount.
simple_interest = ( principal * term * period ) / 100
total_amoount = principal + simple_interest
P = int(input(“Enter Principal amount:”))
n = int(input(“Enter number of years:”))
r = int(input(“Enter rate of interest:”))
Si = (p * n * r)/100
print(Si)
TA = p + Si
print(TA)