AttributeError: 'bool' object has no attribute 'count'
Question: I am new to Python and I am writing this code below.

    
    
    fileName = input("Enter the file name: ")
    InputFile = open(fileName, 'r')
    text=InputFile.readable()
    
    sentences = text.count('.') + text.count('?') + \
                text.count(':') + text.count(';') + \
                text.count('!')
    

I can't get past the count function because of this error below. I have done
some research and tried importing some libraries but that didn't work. Can
someone guide me in the right direction? I feel so lost.

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


Answer: There is a buggy line in your code:

    
    
    text = InputFile.readable()
    

Which returns a `boolean` that has no attribute `count`

Should have been:

    
    
    text = InputFile.read()
    

