AttributeError:“ NoneType”对象没有属性“ count”

时间:2019-01-24 13:55:04

标签: python

我正在为Telegram编写一个小型机器人,并收到此错误:

这是我的代码:

track=['tryp','']    
def main():

    global track
    print (type(track))
    text = 'ewqtd rqrq tryp'
    x = text.split()
    for l in x:
        if  track.count(l) == False:
            track = track.append(l)
            print("Записано слово " + l)
    print(track)

if __name__ == '__main__':

    main()

0 个答案:

没有答案