当我编译下面的Python代码,我得到IndentationError:当实际压痕不取消缩进不匹配任何外部缩进级别缩进错误:取消缩进不匹配任何外部缩进级别
Files = os.listdir(".")
monthNum = 1
totMonths = 0
for year in range(2003, 2016):
os.chdir('./'+str(year))
for month in range(1, 13):
totMonths = totMonths +1
if (month < 10):
monthStr = str(year)+"0"+str(month)
else:
monthStr = str(year)+str(month)
你可以发布完整的追溯? –
您的代码在[tag:python-2.x]和[tag:python-3.x] –
上运行得很好'在范围内的月份有一个选项卡...只需使用四个空格 –