# This progam calculates the perimeter and area of different shapes print("This progam calculates the perimeter and area of different shapes") keep_going = "" while keep_going == "": shape = input("choose a shape from square, rectangle or circle ") #check user input if shape == "square": side = float(input("enter the lengh of a side ")) squere_perimeter = side*4 square_area = side**2 print(f"The perimeter of a square with a length 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}") elif shape == "c": print("circle") radius = float(input("Enter the radius of the circle ")) perimeter = (2 * radius) * 3.14 area = math.pi*(radius**2) print(f"The perimeter of the circle is{perimeter} " f"the area is {area}") else: print("circle") radius = float(input("Enter the radius of the circle ")) perimeter = 2 * radius * 3.14 area = 3.14 * radius**2 print(f"The perimeter of the circle is {perimeter} " f"the area is {area}") keep_going = input("To enter another shape enter or any key to exit") print("The program has ended")