Advertisement
teslariu

q

Aug 30th, 2021
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. """Programa que calcula la superficie de un cìrculo"""
  5.  
  6. __author__ = "Alejandro"
  7. __copyright__ = "PythonProgramming Lu TN EduIT"
  8. __credits__ = ["Pablo","Geraldina"]
  9. __license__ = "GPLv3"
  10. __version__ = "1.0"
  11. __email__ = "ale@yo.com"
  12. __status__ = "Development"
  13.  
  14.  
  15. def superficie_circulo(r):
  16.     """Función que pide un radio y devuelve el àrea del círculo"""
  17.     from math import pi
  18.     return pi * r**2
  19.    
  20. if __name__ == '__main__':
  21.     while True:
  22.         try:
  23.             r = float(input("Ingrese el radio del círculo: "))
  24.         except ValueError:
  25.             print("Debe ingresar un nro")
  26.         else:
  27.             break
  28.     print("La superficie del círculo es {:.2f}".format(superficie_circulo(r)))
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement