# This program calculates the perimeter and area of different shapes print("This program calculates the perimeter and area of different shapes.. lets begin") shape = input("Choose a shape from square (S), rectangle (R) or circle (C) ").upper() # variables keep_going = "Yes".upper() if shape == "S": print("square") side = float(input("Enter the length of a side ")) square_area = side ** 2 square_perimeter = side * 4 print(f"The perimeter of a square with a length of {side} is {square_perimeter} " f"the area is {square_area}") keep_going = input("do you want to try a different shape? type yes to contiune or no to exit").upper() elif shape == "R": print("rectangle") side = float(input("Enter the length of a side ")) side2 = float(input("Enter the length of the other side ")) square_area = side * side2 square_perimeter = side * 2 + side2 * 2 print(f"The perimeter of a rectangle with a length of {side} and a second length of {side2} is {square_perimeter} " f"the area is {square_area}") keep_going = input("do you want to try a different shape? type yes to contiune or no to exit").upper() elif shape == "C": print("Circle") radius = float(input("Enter the length of the radius ")) circumference = radius * 3 square_perimeter = radius * 2 * 3.141592 square_area = (radius ** 2) * 3.141592 print(f"The perimeter of a rectangle with a radius of {radius} which also has a circumfrance of {circumfrance}, is {square_perimeter} "f"the area is {square_area}") keep_going = input("do you want to try a different shape? type yes to contiune or no to exit").upper() elif keep_going == "no": print("The program has ended") else: print("Incorrect shape entered") keep_going = input("do you want to try a different shape? type yes to contiune or no to exit").upper()