Python program to calculate area of Geometric Shapes

 

  Python program to calculate area of Geometric Shapes

radius=float(input("Enter radius: "))

length=float(input("Enter length of rectangle: "))

breadth=float(input("Enter breadth of rectangle: "))

side=float(input("Enter side of square: "))

base=float(input("Enter base of triangle: "))

height=float(input("Enter height of triangle: "))

area=3.14*radius*radius

print("The area of circle is",area)

rect_area=length*breadth

print("The area of rectangle is : ", rect_area)

sq_area=side*side

print("The area of square is:", sq_area)

tri_area=0.5*base*height

print("The area of triangle is:", tri_area)

Output:

Enter radius: 5

Enter length of rectangle: 5

Enter breadth of rectangle: 5

Enter side of square: 5

Enter base of triangle: 5

Enter height of triangle: 5

The area of circle is 78.5

The area of rectangle is :  25.0

The area of square is: 25.0

The area of triangle is: 12.5

टिप्पणी पोस्ट करा

0 टिप्पण्या