import datetime imyear = input("输入与您的出生年份:") nowyear = datetime.datetime .now().year age = nowyear - int(imyear) print("您的年龄为:"+str(age)+"岁") time = datetime.datetime.now() riqi = input("请输入您的出生日期(如:(10, 11)):") monthday = time.month, time.day if riqi == str(monthday): print("Happy Btrthday!") print("这是你第"+str(age)+"个生日") else: print("希望你每天开心")