title: How do I change values of list all at once?
body: <p>Say I have a list:</p>
  <pre><code>lst = [0, 0, 0, 0, 0]
  </code></pre>
  <p>I want to add 1 to each value in the range of indices 0 to 2, so something like this:</p>
  <pre><code>lst[0:3] += 1
  </code></pre>
  <p>However, this is not possible as I get error <em><strong>TypeError: 'int' object is not iterable</strong></em>.</p>
  <p>I know I can use the following loop:</p>
  <pre><code>for i in range(3):
      lst[i] += 1
  </code></pre>
  <p>but this takes O(n) time and I wish to do this process all at once, in O(1) time. Is it possible to do so?</p>