Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- """
- Pedir por teclado el nombre de usuario, si está vacío, volver a pedirlo
- hasta que se ingrese un nombre. Luego, saludar al usuario.
- """
- while True:
- nombre = input("Ingrese su nombre: ")
- # strip borra los espacios vacios
- if nombre.strip():
- print(f"Hola {nombre.strip()}")
- break
Advertisement
Add Comment
Please, Sign In to add comment