# This program calculates the perimeter and area of diffrent shapes print("Shape Calculator") print("This program calculates the perimeter/circumference and area of a square, rectangle, or circle.\n") shape = input("Enter a shape square, rectangle, circle: ").strip().lower() if shape == "square": length = float(input("Enter the length of the square: ")) area = length * length perimeter = length * 4 elif shape == "rectangle": length = float(input("Enter the length of the rectangle: ")) width = float(input("Enter the width of the rectangle: ")) area = length * width perimeter = 2 * (length + width) elif shape == "circle": radius = float(input("Enter the radius of the circle: ")) area = 3.14159 * (radius ** 2) perimeter = 2 * 3.14159 * radius else: print("Invalid shape entered.") area = None if area is not None: print("Answer") print(f"Shape entered: {shape.capitalize()}") print(f"Perimeter/Circumference: {perimeter:.2f}") print(f"Area: {area:.2f}") print("Thank you for using the Shape Calculator. The program has ended.")