title: How to replace the first element of every list in a list of lists?
body: <p>How to replace the first value in a list of lists with a new value?</p>
  <pre><code>list_of_lists = [[&quot;a&quot;, &quot;b&quot;, &quot;c&quot;], [&quot;d&quot;, &quot;e&quot;, &quot;f&quot;], [&quot;g&quot;, &quot;h&quot;, &quot;i&quot;]]
  
  new_values = [1, 2, 3]
  
  for i in list_of_lists:
      for n in range(len(new_values)):
          list_of_lists[n][0] = new_values[n]  
  </code></pre>
  <p>Desired output</p>
  <pre><code>list_of_lists = [[1, &quot;b&quot; ,&quot;c&quot;], [2, &quot;e&quot;, &quot;f&quot;], [3, &quot;h&quot;, &quot;i&quot;]]
  </code></pre>