Advertisement
teslariu

ej_mod

Jul 17th, 2021
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. #Programa que calcula superficies y perímetros:
  5.  
  6. from geometria import area_circulo as circulo, area_triangulo as triangulo
  7. from geometria import ingresar
  8.  
  9. print("Programa que calcula superficies")
  10.  
  11. while True:
  12.     print("""
  13.    Menu de opciones:
  14.    ----------------
  15.    1. Círculo
  16.    2. Triángulo rectángulo
  17.    3. Salir
  18.    """)
  19.    
  20.     opcion = input("Elija su opcion: ")
  21.    
  22.     if opcion == "1":
  23.         radio = ingresar("radio")
  24.         print(f"El area es {circulo(radio)}")
  25.        
  26.     elif opcion == "2":
  27.         base = ingresar("base")
  28.         altura = ingresar("altura")
  29.         print(f"El area es {triangulo(base, altura)}")
  30.    
  31.     elif opcion == "3":
  32.         print("Gracias por usar este programa...")
  33.         break
  34.        
  35.     else:
  36.         print("Opción incorrecta")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement