python
Python

How do you find the area in Python?

#Area of the rectangle 

width=int(input(“Enter the width of Rectangle: “))
height=int(input(“Enter the height of Rectangle: “))
area=width*height
print(“area of Rectangle is”,area)

output

Enter the width of Rectangle: 5                                                                                                            Enter the height of Rectangle: 6                                                                                                                 area of Rectangle is 30

#Area of circle 
PI=3.14
R=float(input(“Enter the Redious of circle: “))
area=PI*R*R
print(“area of circle is”,area)

output

Enter the Redious of circle: 10                                                                                                                   area of circle is 314.0

#Area of triangle

Height=int(input(“Enter the Height of triangle: “))
Base=int(input(“Enter the Base of triangle: “))
area=1/2*Height*Base
print(“area of triangle is”,area)

output

Enter the Height of triangle: 7                                                                                                                     Enter the Base of triangle: 3                                                                                                                        area of triangle is 10.5
#Area of Parallelogram
Height=int(input(“Enter the Verticle Height of Parallelogram: “))
Base=int(input(“Enter the Base of Parallelogram: “))
area=Height*Base
print(“area of Parallelogram is”,area)
output
Enter the Verticle Height of Parallelogram: 5                                                                                          Enter the Base of Parallelogram: 2                                                                                                            area of Parallelogram is 10
#Area of Square
length=int(input(“Enter the length of side: “))
area=length*length
print(“area of Square is”,area)
output
Enter the length of  side: 4
areas of Square is 16

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.