Created
July 23, 2013 03:35
-
-
Save nanzono/6059667 to your computer and use it in GitHub Desktop.
80歳が寿命だとして。
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
# coding:utf-8 | |
import datetime | |
def print_days(birth_year, birth_month, birth_day, target_year): | |
birth_day = datetime.date(birth_year, birth_month, birth_day) | |
today = datetime.date.today() | |
last_day = datetime.date(birth_day.year + target_year, birth_day.month, birth_day.day) | |
print last_day | |
print "Today", today - birth_day | |
print "Last day", last_day - today | |
if __name__ == '__main__': | |
print_days(birth_year=2013, birth_month=7, birth_day=22, target_year=80) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment