Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created June 7, 2020 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/7ff894ad0e24e384fdf10546b1b68333 to your computer and use it in GitHub Desktop.
Save parzibyte/7ff894ad0e24e384fdf10546b1b68333 to your computer and use it in GitHub Desktop.
"""
____ _____ _ _ _
| _ \ | __ \ (_) | | |
| |_) |_ _ | |__) |_ _ _ __ _____| |__ _ _| |_ ___
| _ <| | | | | ___/ _` | '__|_ / | '_ \| | | | __/ _ \\
| |_) | |_| | | | | (_| | | / /| | |_) | |_| | || __/
|____/ \__, | |_| \__,_|_| /___|_|_.__/ \__, |\__\___|
__/ | __/ |
|___/ |___/
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
"""
def dia_de_la_semana(dd, mm, aaaa):
a = int((14 - mm) / 12)
y = aaaa - a
m = int(mm + (12 * a) - 2)
d = int(dd + y + int(y/4) - int(y/100) + int(y/400)+((31*m) / 12)) % 7
return d
def nombre_de_dia(numero_dia):
return ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"][numero_dia]
def main():
dia = int(input("Ingresa el día: "))
mes = int(input("Ingresa el mes: "))
anio = int(input("Ingresa el año: "))
numero_dia = dia_de_la_semana(dia, mes, anio)
dia = nombre_de_dia(numero_dia)
print(f"El día es {dia}")
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment