title: replace None from list with two values
body: <p>I would like to replace <code>None</code> value with <code>0</code> or <code>1</code> depending on some external condition. My solution is:</p>
  
  <pre><code>my_list = [3, 4, 5, None, 6, 7, None, 8, None]
  my_list = [(1 if external_string == "ONE" else 0) if v is None else v for v in my_list]
  </code></pre>
  
  <p>Is this a pythonic way to solve the problem? Let's suppose to have more than two possible value of string in order to assign, for example, 0 if <code>external_string</code> is <code>"ZERO"</code>, 1 if <code>external_string</code> if <code>"ONE"</code>, 2 if <code>external_string</code> is <code>"TWO"</code> and so on: in this case the way I write the code above is stylistically acceptable?</p>