How to replace a dot with a string in a python list
<pre><code>my_list = ['b','.','.']

expected_list = ['b','.','w']
</code></pre>

<p>May be simple, moving into python recently so any suggestions would be fine</p>

<blockquote>
  <p>You can do this by using list comprehension also</p>
</blockquote>

<pre><code>l = ['w' if i == '.' else i for i in my_list]
</code></pre>

python python-2.7