#This program will ask for a shape and measurement. It will calculate the area and perimiter of the shape print("This program calculates the area and perimiter of a shape.") keep_going = "" while keep_going == "": shape = input("Choose a shape s for square, r for rectangle, c for circle, t for triangle, and tr for trapezoid. No caps. " ) if shape == 's': length = int(input("What is the length of your square? " )) per1 = length + length + length + length area1 = length * length print(f"The perimiter is {per1} and the area is {area1}. ") elif shape == 'r': length = int(input("What is the length of your rectangle? " )) width = int(input("What is the width of your rectangle? " )) per2 = width + length + width + length area2 = width * length print(f"The perimiter is {per2} and the area is {area2}. ") elif shape == 'c': radius = int(input("What is the radius of your circle? " )) cir = 2 * 3.14 * radius area3 = radius * radius * 3.14 print(f"The circumference is {cir} and the area is {area3}. ") elif shape == 't': base = int(input("What is the base of your triangle? " )) a = int(input("What is the length of one side of your triangle? ")) b = int(input("What is the length of the other side of your triangle? ")) hight = int(input("What is the hight of your triangle? ")) per3 = a + base + b area4 = base * hight / 2 print(f"The perimiter is {per3} and the area is {area4}. ") elif shape == 'tr': base2 = int(input("What is the base of your trapezoid? " )) aside = int(input("What is the length left side of your trapezoid? ")) bside = int(input("What is the length right side of your trapezoid? ")) top = int(input("What is the length of the top of your trapezoid? ")) hight2 = int(input("What is the hight of you trapezoid? ")) per4 = aside + top + bside + base2 area5 = top + base2 / 2 * hight2 print(f"The perimiter is {per4} and the area is {area5}. ") else: print("This shape is unavalible") keep_going = input("Do you want to calculate another shape? Press the enter button to continue or no to exit. " ) print("The program has ended")