源码:
x = input("输入:\n")#年份year = x[6:10]month = x[10:12]day = x[12:14]old = - 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)
如果觉得《Python:输入身份证号 计算出生日期 年龄 性别(源码+效果图)》对你有帮助,请点赞、收藏,并留下你的观点哦!