# 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) ") 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}") 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}") else: print("C") 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}") print("The program has ended")