余三十有七

世界上唯一不用努力就能得到的只有年龄,成长不期而遇。这一年头发白了不少。

#!/usr/bin/python

from datetime import date

today = date.today()

#Change this to your birth date
date_of_birth = date(1981, 11, 20)

birthday = date(today.year, date_of_birth.month, date_of_birth.day)
days_until_birthday = (birthday-today).days
days_alive = (today-date_of_birth).days

print( 'You are ' + str(days_alive) + ' days old')

if days_until_birthday > 0:
	print( 'It\'s ' + str(days_until_birthday) + ' days until your Birthday')
elif days_until_birthday == 0:
	print( 'Happy Birthday!')
else:
	print( 'You\'ll have to wait until next year for another birthday')

You are 13514 days old
Happy Birthday!

赞(0) 打赏
未经允许,不得转载本站任何文章:不忘初心的知与行 » 余三十有七

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏