#Title: Shape Calculator #Author: Ari Ross #Date: 4/11/2026 #Version: 1 #Purpose: To calculate the area, perimeter and circumference of various shapes. #Setup of functions and variables #Keeps track of user consent loop = True #Asks the user for a shape def question(): shape = input("Choose a shape from square, rectangle or circle: ") return shape #Does math for a square def square_math(): print("Square") side = float(input("Enter the side length: ")) square_area = side **2 square_perimeter = side * 4 return [side, square_area, square_perimeter] #Does math for a rectangle def rectangle_math(): print("Rectangle") width = float(input("Enter the width: ")) height = float(input("Enter the height: ")) rectangle_area = width * height rectangle_perimeter = 2 * (width + height) return [width, height, rectangle_area, rectangle_perimeter] #Does math for a circle def circle_math(): print("Circle") radius = float(input("Enter the radius: ")) area = 3.141592 * (radius **2) circumference = 2 * 3.15159 * radius return [radius, area, circumference] #Program def program(): #Input shape = question() #Math if shape == "square": square_list = square_math() print(f"The area of a square with {square_list[0]} long sides is {square_list[1]}. The perimeter is {square_list[2]}") elif shape == "rectangle": rectangle_list = rectangle_math() print(f"The area of a rectangle with a width of {rectangle_list[0]} and a height of {rectangle_list[1]} is {rectangle_list[2]} and its perimeter is {rectangle_list[3]}") elif shape == "circle": circle_list = circle_math() print(f"The area of a circle with a radius of {circle_list[0]} is {circle_list[1]} and it's circimference is {circle_list[2]}") else: print("That wasn't an option") consent = input("Would you like to go again? [Y/N] ") if consent != 'Y': loop = False else: loop = True return loop #Intro print("This program calculates the perimeter and area of different shapes... let's begin") #Body while loop == True: loop = program() #Outro print("The program has ended")