私はPythonを初めて使用しています。私はこのコードを以下に書いています。AttributeError: 'bool'オブジェクトに 'count'属性がありません
fileName = input("Enter the file name: ")
InputFile = open(fileName, 'r')
text=InputFile.readable()
sentences = text.count('.') + text.count('?') + \
text.count(':') + text.count(';') + \
text.count('!')
以下のエラーのためカウント機能を超えることはできません。私はいくつかの研究を行い、いくつかのライブラリをインポートしようとしましたが、うまくいかなかった。誰かが正しい方向に私を導くことができますか?私は失われたように感じる。
text.count(':') + text.count(';') + \
AttributeError: 'bool' object has no attribute 'count'
あなたはどう思いますが、 'text = InputFile.readable()'はやっていますか? – jwodder