using while
Wed Feb 02 2022 00:23:21 GMT+0000 (Coordinated Universal Time)
Saved by
@aymenben99
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")
content_copyCOPY
Comments