Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- """Modulo que implementa diversas funciones aritmèticas"""
- __author__ = "ALB"
- __copyright__ = "Educacion IT"
- __credits__ = ["Juan", "Ana", "Victor"]
- __license__ = "GPLv3"
- __version__ = "0.9"
- __email__ = "[email protected]"
- __status__ = "Development"
- def cubo(x):
- """Función que recibe un nro como argumento y devuelve su cubo"""
- return x ** 3
- def ingresar_nro():
- while True:
- try:
- nro = float(input("Ingrese un nro: "))
- except ValueError:
- print("Error: debe ingresar un número")
- else:
- return nro
- if __name__ == '__main__':
- """Ejemplo de uso de las funciones del módulo aritmetica.py"""
- numero = ingresar_nro()
- print(f"El cubo de {numero} es {cubo(numero)}")
Advertisement
Add Comment
Please, Sign In to add comment