# This program calculates the perimeter and the area of different shapes print("This program calculates the perimeter and the area of different shapes") keep_going = "" while keep_going == "": shape = input("Choose a shape from sqaure (s),rectangle (r) or circle (c) ") # Check user input if shape=="s": print("square") side = float(input("Enter the length of a side ")) square_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}") elif shape=="rectangle": print("r") length = float(input("Enter the length of the rectangle ")) width = float(input("Enter the width of the recatngle ")) perimeter = (length + width) * 2 area = width * length print(f"The perimeter of a rectangle is {perimeter} " f"the area is {area}") print("square") elif shape == "c": 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 a circle is {perimeter} " f"the area is {area}") else: print("that is not a valid shape") keep_going = input("To enter another shape press enter or any key to exist") print("The program has ended")