Python: TypeError: object of type 'NoneType' has no len()

前端 未结 4 1240
-上瘾入骨i
-上瘾入骨i 2021-02-14 15:56

I am getting an error from this Python code:

with open(\'names\') as f:
    names = f.read()
    names = names.split(\'\\n\')
    names.pop(len(names) - 1)
    n         


        
4条回答
  •  囚心锁ツ
    2021-02-14 16:45

    I was faces this issue but after change object into str, problem solved. str(fname).isalpha():

提交回复
热议问题