Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- """Programa que calcula la superficie de un cìrculo"""
- __author__ = "Alejandro"
- __copyright__ = "PythonProgramming Lu TN EduIT"
- __credits__ = ["Pablo","Geraldina"]
- __license__ = "GPLv3"
- __version__ = "1.0"
- __email__ = "ale@yo.com"
- __status__ = "Development"
- def superficie_circulo(r):
- """Función que pide un radio y devuelve el àrea del círculo"""
- from math import pi
- return pi * r**2
- if __name__ == '__main__':
- while True:
- try:
- r = float(input("Ingrese el radio del círculo: "))
- except ValueError:
- print("Debe ingresar un nro")
- else:
- break
- print("La superficie del círculo es {:.2f}".format(superficie_circulo(r)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement