# 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 (s), rectangle (r) or circle (c) ") # Check user input if shape == "s": print("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}") elif shape == "r": 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")) circumfrence = (2 * radius) * 3.14 area = 3.14 * radius**2 print (f"the circumfrence of the circle is {circumfrence:.2f} " f"the area is {area}") else: print ("that is not a valid shape") print ("the program has ended")