Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # bosquejo de un paquete
- """Programa que calcula el cubo de un nro"""
- __author__ = "Ale"
- __copyright__ = "Python Programming"
- __credits__ = ["Pepe","Ana","Juana"]
- __license__ = "GPL"
- __version__ = "3.0"
- __email__ = "[email protected]"
- __status__ = "Development"
- def cubo():
- """Función que calcula el cubo de un nro"""
- y = ingresar_numero()
- return y**3
- def ingresar_numero():
- """Funciòn que valida el ingreso de un nro"""
- while True:
- try:
- n = float(input("Ingrese un nro: "))
- except ValueError:
- print("No ha ingresado un nro")
- else:
- return n
- if __name__ == "__main__":
- x = cubo()
- print(f"El cubo es {x:.6f}")
Advertisement
Add Comment
Please, Sign In to add comment