相关疑难解决方法(0)

TypeError:尝试访问列表时,'list'对象不可调用

我正在尝试运行此代码,我有一个列表列表.我需要添加到内部列表,但我得到错误

TypeError: 'list' object is not callable.
Run Code Online (Sandbox Code Playgroud)

任何人都可以告诉我这里我做错了什么.

def createlists():
    global maxchar
    global minchar
    global worddict
    global wordlists

    for i in range(minchar, maxchar + 1):
        wordlists.insert(i, list())
    #add data to list now
    for words in worddict.keys():
        print words
        print  wordlists(len(words)) # <--- Error here.
        (wordlists(len(words))).append(words)  # <-- Error here too
        print "adding word " + words + " at " + str(wordlists(len(words)))
    print wordlists(5)
Run Code Online (Sandbox Code Playgroud)

python callable

52
推荐指数
4
解决办法
41万
查看次数

标签 统计

callable ×1

python ×1