title: Filter 'None' output Python using filter()
body: <p>I am getting an error when trying to filter the 'None' output, when using the filter function in Python, here is my code: </p>
  
  <pre><code>def my_function(x):
  if (x % 2 == 0):
      x=filter(None, x)
      return(x)
  
  for x in range(1, 10):
      sum=sum+(my_function(x))
      print(sum)
  </code></pre>
  
  <p>and Python cannot make the sum as the None output cannot be removed, because it is "adding" this</p>
  
  <pre><code>None
  2
  None
  4
  None
  6
  None
  8
  None
  </code></pre>
  
  <p>and not this</p>
  
  <pre><code>2
  4
  6
  8
  </code></pre>