源码:
x = input("输入:\n") #年份 year = x[6:10] month = x[10:12] day = x[12:14] old = 2021 - eval(year)#根据具体年份来算年龄 sex = x[16:18] s = eval(sex) if(s%2==0): sex1 ="男" else: sex1 ="女" print("输出:\n", "你出生于", year, "年", month, "月", day, "日") print("你今年", old, "岁") print("你的性别为", sex1)