title: TypeError: endswith first arg must be str or a tuple of str, not bool
body: <p>I was trying to count the occurrences of words which end with several suffixes. I thought that <code>endswith</code> would accept an iterable; unfortunately, it did not. Below is the code snippet:</p>
  
  <pre><code>s = 'like go goes likes liked liked liking likes like'
  lst = s.split()
  suffixes = ['s', 'es', 'ies', 'ed', 'ing']
  
  counter = 0
  prompt = 'like'
  for x in lst:
      if x.startswith(prompt) and x.endswith(any(suffix for suffix in suffixes)):
           counter += 1
  </code></pre>
  
  <p>The value of <code>counter</code> should be <code>4</code> at the end of the execution. This is the error message which is displayed:</p>
  
  <pre><code>TypeError: endswith first arg must be str or a tuple of str, not bool
  </code></pre>
  
  <p>How can I get the above code to work?</p>