我从这个 Python 代码中得到一个错误:
with open('names') as f:
names = f.read()
names = names.split('\n')
names.pop(len(names) - 1)
names = shuffle(names)
f.close()
assert len(names) > 100
错误:
Python: TypeError: object of type 'NoneType' has no len()
断言语句抛出此错误,我做错了什么?