Last active
September 20, 2016 19:35
-
-
Save rafaelmv/21bfbb5b34b87b32a794c9cfa97460eb 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
from datetime import date | |
year = int(input("Anio de nacimiento: ")) | |
month = int(input("Mes de nacimiento: ")) | |
day = int(input("Dia de nacimiento: ")) | |
def born(year, month, day): | |
today = date.today() | |
return today.year - year - ((today.month, today.day) < (month, day)) | |
age = born(year, month, day) | |
print("Tienes " + str(age) + " anios") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment