Skip to content

To calculate perimeter/circumference and area of shapes such as triangle, rectangle, square and circle.

Class 11th IP (065)

To calculate perimeter/circumference and area of shapes such as triangle, rectangle, square and circle.

SOLUTION..

import math # Rectangle l = float(input("Length: ")) b = float(input("Breadth: ")) print("Rectangle Area =", l * b) print("Rectangle Perimeter =", 2 * (l + b)) # Square s = float(input("Side: ")) print("Square Area =", s * s) print("Square Perimeter =", 4 * s) # Circle r = float(input("Radius: ")) print("Circle Area =", math.pi * r * r) print("Circumference =", 2 * math.pi * r)