title: Modifying a list inside a function
body: <p>Suppose I have function with list parameter, and inside its body I want to modify passed list, by copying elements of an array to the list:<br></p>
  
  <pre><code>def function1 (list_arg):
     a = function2()    #function2 returns an array of numbers
     list_arg = list(a)
  
  list1 = [0] * 5
  function1(list1)
  list1
  [0,0,0,0,0]
  </code></pre>
  
  <p>When doing it like this, it doesn't work. After executing <code>function1(list1)</code>, <code>list1</code> remains unchanged. So, how to make <code>function1</code> return <code>list1</code> with the same elements (numbers) as array <code>a</code>?  </p>