title: Can I write a lambda function to raise an exception?
body: <p>Suppose I have the following python list:</p>
  
  <pre><code>my_list = [1, 2,'X', 'Y', 0]
  </code></pre>
  
  <p>Suppose I want to copy values of this list into a new list as follows:</p>
  
  <ol>
  <li>If it is a digit between 0-9, copy that value into the new list</li>
  <li>ElIf it is 'X', copy <code>None</code> into the new list</li>
  <li>Else raise an Exception</li>
  </ol>
  
  <p>Can I do it with a lambda function as shown below? If so, how?</p>
  
  <pre><code>new_list = map(lambda(x): something-here-but-what??, my_list)
  </code></pre>