teslariu

ingresar

Dec 23rd, 2021
1,889
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. #  ingreso.py DEBEN ESTAR EN LA MISMA CARPETA
  5.  
  6. def ingresar_numero(n):
  7.     while True:
  8.         try:
  9.             numero = float(input(f"Ingrese un numero {n}: "))
  10.         except Exception:
  11.             print("Error: debe ingresar un nĂºmero")
  12.         else:
  13.             return numero
Advertisement
Add Comment
Please, Sign In to add comment