title: How to count num letter appears in the word with reduce?
body: <p>I'm trying to understand how is the next example is really work.
  this function is basically will count the number of times the letter appears in the word, but unfortunately it is a bit incomprehensible to me. I would love to get some good explanation for this.</p>
  <pre><code>def count_appearances1(letter, word):
  
      func = lambda counter,l: counter + 1 if l == letter else counter
  
      return reduce(func, word,0)
  </code></pre>