title: Modify global list
body: <p>I have a couple lists that I create, one example being:</p>
  
  <pre><code>onButtonVal = [0] * 8
  onButtonVal = [0 for i in xrange(8)]
  </code></pre>
  
  <p>and then a modify function:</p>
  
  <pre><code>def buttonSelectOn(outlet):
  
      global onButtonVal
  
      if outlet == 1:
          onButtonVal[0] = 1
  </code></pre>
  
  <p>and I try to access it in another function:</p>
  
  <pre><code>def applySettings(outlet):
  
      if outlet == 1:
          if onButtonVal[0] == 1:
              turnOnOutlet(1)
  </code></pre>
  
  <p>When I try to do all this, I get <code>TypeError: 'int' object does not support item assignment</code></p>
  
  <p>What am I doing wrong? I just want to create a simple array/list of 8 ints and be able to modify it in one function and access it in others</p>