我一直在寻找一个明确的答案。我读过很多关于使用日期时间的帖子和其他网站,但是我如何构建一个简单的程序来提示用户输入两个特定的日期,然后计算这些日期之间的差异呢?我一直在琢磨如何得到月份和天数。在
到目前为止,我得到的是:print ("How old will you be when you graduate?")
print ("If you want to know, I'll have to ask you a few questions.")
name = input('What is your name? ')
bYear = int(input("What year were you born? "))
print ("Don't worry. Your information is safe with me.")
bMonth = int(input("What month were you born? "))
bDay = int(input("How about the day you were born? "))
print ("Fantastic. We're almost done here.")
gYear = int(input("What year do you think you'll graduate? "))
gMonth = int(input("What about the month? "))
gDay = int(input("While you're at it, give me the day too. "))