小编Est*_*r28的帖子

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

我正在尝试在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)

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

python int list typeerror

9
推荐指数
1
解决办法
4万
查看次数

标签 统计

int ×1

list ×1

python ×1

typeerror ×1