# this program calculates the perimeter and area of different shapes print ("this program calculates the perimeter and area of different shapes ") shape = input("choose a shape from either, square, rectangle or circle ") # Check user input if shape == "square": side = float(input("enter the lenth of a side ")) square_perimeter = side *4 square_area = side **2 print(f"the perimeter of a square with a lenth of {side}={square_perimeter} the area = {square_area}") print("square") elif shape == "rectangle": print ("rectangle") length = float(input("enter the length of the rectangle")) width = float(input("enter the width of the rectangle")) perimeter = (length + width) * 2 area = width * length print(f"the perimeter of the rectangle is {perimeter} " f"the area is {area}") else: print ("circle") print ("the program has ended")