Reduce function in Python
<p>I used the <a href="http://docs.python.org/library/functions.html#reduce" rel="nofollow">reduce</a> function to multiply all the elements of a list as follows.</p>

<pre><code>l = [1,2,3,4,5]
reduce(lambda x,y:x*y,l) #returns 120
</code></pre>

<p>Now, suppose I have a list, <code>l = [1,'apple',2,'apple','apple']</code>, and I want to count how many times the word "apple" appears in the list. Is this possible using reduce? </p>

<p>I'm aware I can use <code>l.count('apple')</code>, but I want to know if a reduce solution is possible.</p>
