输入并运行成功判断天数的程序。(1分)
题目内容:
请按照图片展示的代码,手工输入到Thonny或者IDLE中,运行成功。
时间限制:500ms内存限制:32000kb
import datetime dtstr = "20181206" dt = datetime.datetime.strptime(dtstr,"%Y%m%d") another_dtstr = dtstr[:4]+"0101" another_dt = datetime.datetime.strptime(another_dtstr,"%Y%m%d") print(int((dt-another_dt).days)+1)
文章来源: https://blog.csdn.net/Jwenxue/article/details/90212563