calculate_area() This example prompts the user to choose a shape and then calculates its area based on the input dimensions. Naturist Install Freedom Family At Farm Nudist Nudism Full Link
def calculate_area(): print("Choose a shape:") print("1. Square") print("2. Circle") Sp Furo 22 Free [WORKING]
choice = input("Enter your choice (1/2): ")
if choice == '1': side = float(input("Enter side length of the square: ")) area = side ** 2 print(f"Area of the square: {area}") elif choice == '2': radius = float(input("Enter radius of the circle: ")) area = 3.14159 * (radius ** 2) print(f"Area of the circle: {area}") else: print("Invalid choice")