-2
words = [ 'look', 'into', 'my', 'eyes', 'look', 'into', 'my', 'eyes', 'the', 'eyes', 'the', 'eyes', 'the', 'eyes', 'not', 'around', 'the', 'eyes',"don't", 'look', 'around', 'the', 'eyes', 'look', 'into', 'my', 'eyes', "you're", 'under']
def requirement(word):
onelist = []
if word in words:
return(len(onelist.append(word)))
print(map(requirement('look'), words))
エラーなぜ "TypeError:型 'NoneType'のオブジェクトにlen()がありませんか?私は "マップ" 機能を練習したい
TypeError: object of type 'NoneType' has no len()
。しかし、私はlen()を使うと間違いを犯したようです。
のようなものを試してみてくださいあなた' '' len'呼び出しから 'list.append'コールを分離するために定義さonelist'.Youない上、関数' list.append'に 'len'を呼び出して再。 –
@Coal_好奇心の念から、コメントにエンコードされたアポストロフィーはどうでしたか? – Carcigenicate
私は手がかりがない、私はとにかくアプリには、バグかもしれない:) –