python - AttributeError: 'bool' object has no attribute 'count' -


i new python , writing code below.

filename = input("enter file name: ") inputfile = open(filename, 'r') text=inputfile.readable()  sentences = text.count('.') + text.count('?') + \             text.count(':') + text.count(';') + \             text.count('!') 

i can't past count function because of error below. have done research , tried importing libraries didn't work. can guide me in right direction? feel lost.

 text.count(':') + text.count(';') + \ attributeerror: 'bool' object has no attribute 'count' 

there buggy line in code:

text = inputfile.readable() 

which returns boolean has no attribute count

should have been:

text = inputfile.read() 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

mongodb - Multiple $and with multiple $or in $match mongoose -

Teradata TPT_INFRA: TPT02640: Error: Conflicting column count -