enter image description here enter image description here 我已尽力尝试一切都行不通
print ("Enter today's date:")
DateToday = input()
print ("Enter your birthday {yyyy/mm/d)"
BDate = input()
Age = DateToday - BDate
print Age.year
答案 0 :(得分:0)
我假设您只想要一年的年龄? 在这种情况下,您可以这样做:
datetoday = int(input("Enter the current year: "))
bdate = int(input("Enter your birth year: "))
age = datetoday - bdate
print ("Your age is: " + str(age))
您忘记添加一些括号,并索要不必要的数据。这将给一个人几岁。