title: Python weird thing with list local and global scope
body: <p>Why can we modify list with the <strong>append method</strong> but can't do the same with the <strong>list concatenation</strong>?
  I know about the local and global scope, I'm confused about why we can do it with append method, thanks in advance</p>
  <pre><code>some_list=[]
  
  def foo():
      some_list.append('apple')
  
  
  foo()
  print(some_list)
  #it works
  </code></pre>
  <p>with list concatenation</p>
  <pre><code>some_list=[]
  
  def foo():
      some_list+=['apple']
  
  
  foo()
  print(some_list)
  #UnboundLocalError: local variable 'some_list' referenced before assignment
  </code></pre>