Created
April 23, 2020 15:42
-
-
Save parzibyte/094e6b3611e5531f53e5baf4a1f28b7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
____ _____ _ _ _ | |
| _ \ | __ \ (_) | | | | |
| |_) |_ _ | |__) |_ _ _ __ _____| |__ _ _| |_ ___ | |
| _ <| | | | | ___/ _` | '__|_ / | '_ \| | | | __/ _ \ | |
| |_) | |_| | | | | (_| | | / /| | |_) | |_| | || __/ | |
|____/ \__, | |_| \__,_|_| /___|_|_.__/ \__, |\__\___| | |
__/ | __/ | | |
|___/ |___/ | |
Blog: https://parzibyte.me/blog | |
Ayuda: https://parzibyte.me/blog/contrataciones-ayuda/ | |
Contacto: https://parzibyte.me/blog/contacto/ | |
Copyright (c) 2020 Luis Cabrera Benito | |
Licenciado bajo la licencia MIT | |
El texto de arriba debe ser incluido en cualquier redistribución | |
""" | |
from datetime import datetime | |
while True: | |
try: | |
fecha = input("Ingresa una fecha en el formato YYYY-MM-DD: ") | |
datetime.strptime(fecha, '%Y-%m-%d') | |
print("Fecha válida") | |
except ValueError: | |
print("Fecha inválida") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment