TypeError:不支持的操作数类型 - :'int'和'list'

Est*_*r28 9 python int list typeerror

我正在尝试在python中创建一个程序,它会告诉你使用Zeller算法http://en.wikipedia.org/wiki/Zeller%27s_congruence出生的那一天,但它给了我这个错误

TypeError:不支持的操作数类型 - :'int'和'list'

这是为什么?

date = raw_input ("Introduce here the day, month and year you were born like this: DDMMYYYY")

if date.isdigit() and len(date) == 8:
    day = date[0:2]
    month = date[2:4]
    year = date[4:8]
    day = int(day)
    month = int(month)
    year = int(year)
    result = (day + (month + 1) * 2.6, + year % 100 + (year % 100) / 4 - 2 * [year / 100]) % 7
Run Code Online (Sandbox Code Playgroud)

(这是我自己创建的第一个程序,所以请好一点;))

Jon*_*nts 4

@mellamokb 和评论已经回答了您的直接问题的答案......

不过,我要指出的是,Python 已经内置了,并且会让它变得更容易:

from datetime import datetime
d = datetime.strptime('1312981', '%d%m%Y')
# datetime(1981, 12, 13, 0, 0)
Run Code Online (Sandbox Code Playgroud)

datetime然后,您可以更轻松地对实际上是字符串而不是强制字符串的对象执行计算......