【发布时间】:2012-11-29 16:38:43
【问题描述】:
好的,所以我正在编写一个程序来查找星期几,并且程序运行顺利,直到这个块
D = input()
A = ( (14 - 'month') /12)
Y = ( 'Year' - 'A' )
MonthProblem = ( 'month' + 12 * 'A' - 2 )
week = ( ('D' + 'Y' + 'Y'/4 - 'Y'/100 + 'Y'/400 + 31 * 'MonthProblem'/12) % 7 )
错误是 TypeError: unsupported operand type(s) for -: 'int' and 'str'
【问题讨论】:
-
你使用什么语言?
-
语法错误和尝试看起来像python,但我可能错了。
-
请去掉多余的大括号。
-
这个程序我用python
标签: python string int typeerror