Skip to content

Instantly share code, notes, and snippets.

@nicolasmendoza
Last active September 9, 2017 01:03
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 nicolasmendoza/e44729034f0dc735c53ade8a0cf0f700 to your computer and use it in GitHub Desktop.
Save nicolasmendoza/e44729034f0dc735c53ade8a0cf0f700 to your computer and use it in GitHub Desktop.
def days_of(month):
months = {"Enero": 31, "Febrero": 28, "Marzo": 31, "Abril": 30, "Mayo": 31, "Junio": 30, "Julio": 31,
"Agosto": 31, "Septiembre": 30, "Octubre": 31, "Noviembre": 30, "Diciembre": 31}
if months.get(month, None):
message = "El mes de {name} posee {days} días.".format(name=month, days=months[month])
if month == 'Febrero':
message += " Salvo los años bisiestos."
return message
return 'Mes incorrecto.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment