Skip to content

Instantly share code, notes, and snippets.

@dalejandroramirez
Created September 14, 2017 02:13
Show Gist options
  • Save dalejandroramirez/64afe02eb92c435e77580d76a7764553 to your computer and use it in GitHub Desktop.
Save dalejandroramirez/64afe02eb92c435e77580d76a7764553 to your computer and use it in GitHub Desktop.
dado un año devuelve el siglo en que se encuentra. El primer siglo se extiende desde el año 1 hasta el año 100 inclusive, el segundo - desde el año 101 hasta el año 200 incluido, etc.
def centuryFromYear(year):
m=year/100
if year%100==0:
return(year/100)
else:
return(int(m)+1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment