teslariu

ingreso nombres

May 30th, 2022
1,082
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. Pedir por teclado el nombre de usuario, si
  5. está vacío, volver a pedirlo hasta que se ingrese
  6. un nombre.
  7. Luego, saludar al usuario.
  8. """
  9. while True:
  10.     nombre = input("Ingrese su nombre: ")
  11.     if nombre.strip() != "":
  12.         break
  13. print(f"Hola {nombre}")
Advertisement
Add Comment
Please, Sign In to add comment