title: AttributeError: can't set attribute in python
body: <p>Here is my code</p>
  <pre><code>N = namedtuple(&quot;N&quot;, ['ind', 'set', 'v'])
  def solve():
      items=[]
      stack=[]
      R = set(range(0,8))
      for i in range(0,8):
          items.append(N(i,R,8))      
          stack.append(N(0,R-set(range(0,1)),i))
      while(len(stack)&gt;0): 
          node = stack.pop()
          print node
          print items[node.ind]   
          items[node.ind].v = node.v
  </code></pre>
  <p>In the last line I cant set the <code>items[node.ind].v</code> value to <code>node.v</code> as I want, and am getting the error</p>
  <pre><code>&quot;AttributeError: can't set attribute&quot;
  </code></pre>
  <p>I don't know what's wrong but it must be something based on syntax as using statements like <code>node.v+=1</code> is also showing same error. I'm new to Python, so please suggest a way to make the above change possible.</p>