python project for calculating area of circle, triangle,rectangle

print("MENU")
print("1.area of circle")
print("2.area of a triangle")
print("3.area of a rectangle")
flag="y"
while (flag=="y"):


n=int(input("enter your choice 1/2/3"))
if n ==1:
r= int(input("enter the radius of circle"))
print("the area of circle is : ",3.13*r*r)
elif n==2:
s=int(input("enter the length of a side of a square "))
print("the area of circle is :", s*s)
elif n==3:
a= int(input("enter the length of the rectangle"))
b=int(input("enter the breadth of the rectangle"))
print("the area of a rectangle :",a*b)
else:
print("invalid number ")


flag=input("do you want to continue to yes /no ")

OUTPUT...

MENU
1.area of circle
2.area of a triangle
3.area of a rectangle

enter your choice 1/2/356
invalid number
do you want to continue to yes /no y

enter your choice 1/2/31
enter the radius of circle56
the area of circle is :  9815.68

enter your choice 1/2/33
enter the length of the rectangle54
enter the breadth of the rectangle56
the area of a rectangle : 3024
 


ARIHANT JAIN

i am arihant jain and i am a student

Post a Comment (0)
Previous Post Next Post