Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """
- Módulo que implementa el cálculo de perímetro y superficie de distintas
- figuras geométricas
- """
- from math import pi
- def ingresar_numero():
- while True:
- try:
- numero = float(input("Ingrese un número: "))
- except ValueError:
- print("No ha ingresado un número")
- else:
- return numero
- def cuadrado(l):
- return [l*4, l**2]
- def rectangulo(l,L):
- return [(l+L)*2, l*L]
- def circulo(r):
- return [2*pi*r, pi*r**2]
- def imprimir(lista):
- print(f"Perimetro: {lista[0]} - Superficie: {lista[1]}")
- def mostrar_pi():
- print(pi)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement