title: How to use filter, map, and reduce in Python 3
body: <p><code>filter</code>, <code>map</code>, and <code>reduce</code> work perfectly in Python 2. Here is an example:</p>
  
  <pre><code>&gt;&gt;&gt; def f(x):
          return x % 2 != 0 and x % 3 != 0
  &gt;&gt;&gt; filter(f, range(2, 25))
  [5, 7, 11, 13, 17, 19, 23]
  
  &gt;&gt;&gt; def cube(x):
          return x*x*x
  &gt;&gt;&gt; map(cube, range(1, 11))
  [1, 8, 27, 64, 125, 216, 343, 512, 729, 1000]
  
  &gt;&gt;&gt; def add(x,y):
          return x+y
  &gt;&gt;&gt; reduce(add, range(1, 11))
  55
  </code></pre>
  
  <p>But in Python 3, I receive the following outputs:</p>
  
  <pre><code>&gt;&gt;&gt; filter(f, range(2, 25))
  &lt;filter object at 0x0000000002C14908&gt;
  
  &gt;&gt;&gt; map(cube, range(1, 11))
  &lt;map object at 0x0000000002C82B70&gt;
  
  &gt;&gt;&gt; reduce(add, range(1, 11))
  Traceback (most recent call last):
    File "&lt;pyshell#8&gt;", line 1, in &lt;module&gt;
      reduce(add, range(1, 11))
  NameError: name 'reduce' is not defined
  </code></pre>
  
  <p>I would appreciate if someone could explain to me why this is.</p>
  
  <p>Screenshot of code for further clarity:</p>
  
  <p><a href="https://i.imgur.com/WekeD.png" rel="noreferrer"><img src="https://i.imgur.com/WekeD.png" alt="IDLE sessions of Python 2 and 3 side-by-side"></a></p>