while 1: print("choose an option:") print("1 - area circulo") print("2 - area rectangulo") print("write stop to close") option = input() if option == "1": radio= int(input("Enter the radius of the circle:")) pi=3.14 area = pi*(radio**2) print("The area of the circle""is: ",area) elif option == "2": lado = int(input("Enter the length of the side:")) base = int(input("Enter the length of the other side:")) area = lado*base print("The area of the rectangle is: ",area) elif option=="stop": break else: print("not a figure")
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter