import datetime imyear = input("输入与您的出生年份:") nowyear= datetime.datetime .now().year age= nowyear- int(imyear) print("您的年龄为:"+str(age )+"岁") # 根据计算年龄判断所处年龄阶段 if age<18: print("您现在是未成年人~@_@~") if age>=18 and age<66: print("您现在是成年人(—_—)") if age>=66 and age<80: print("您现在为中年人~@_@~") if age>=80: print("您现在为老年人*—_—*") #图我懒得截,自己运行看看。
初级程序员
by: 云代码会员 发表于:2021-11-11 17:47:12 顶(1) | 踩(1) 回复
686876
回复评论