请任何人都可以帮助我编写正确的代码。我正在尝试创建一个字符串元组,其中包含 Microsoft Excel 支持的日期范围内的日期,例如(“2013-Oct-17”、“2100-01-01”)。
我的代码:
import time
import math
DAYS = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
FULL_MONTHS = ("January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December")
mm_ = tuple(str(date) for date in range(2013-oct-17, 2100-01-01))
print mm_
当我运行它时它给了我以下错误(输出):
mm_ = tuple(str(date) for date in range(2013-oct-17, 2100-01-01))
TypeError: unsupported operand type(s) for -: 'int' and 'builtin_function_or_method'