title: Python remove a character with lambda
body: <p>I want to remove “X” form this string.
  What is wrong with my code?</p>
  <pre><code>garbled = &quot;IXXX aXXmX aXXXnXoXXXXXtXhXeXXXXrX sXXXXeXcXXXrXeXt mXXeXsXXXsXaXXXXXXgXeX!XX&quot;
  message=filter(lambda x: x==&quot;X&quot; x=='' ,garbled)
  print message
  </code></pre>
  <p>I know that this one works:</p>
  <pre><code>garbled = &quot;IXXX aXXmX aXXXnXoXXXXXtXhXeXXXXrX sXXXXeXcXXXrXeXt mXXeXsXXXsXaXXXXXXgXeX!XX&quot;
  message=filter(lambda x: x!=&quot;X&quot; ,garbled)
  print message
  </code></pre>