title: Changing the passed-in list within a function
body: <p>Consider the Python code below:</p>
  <pre><code>def change_list(in_list):
      in_list = [1,2,3]
  
  def change_list_append(in_list):
      in_list.append(7)
  
  
  my_list = [1,2,3,4,5,6]
  
  change_list(my_list)
  print(my_list)
  
  change_list_append(my_list)
  print(my_list)
  </code></pre>
  <p>The output is:</p>
  <pre><code>[1, 2, 3, 4, 5, 6]
  [1, 2, 3, 4, 5, 6, 7]
  </code></pre>
  <p>I don't understand why the first call (change_list) did not result in my_list to become [1,2,3]. Can someone explain? Look at what happens with the call to change_list_append: number 7 is appended to my_list.</p>