title: How to change the scope of a variable in a function? Python
body: <p>This may seem like a really stupid question but I am confused regarding the scope rules in Python. In the following example I send two variables (x,y) with values to a function which is supposed to change their values. When I print the results the variables had not changed. </p>
  
  <pre><code>def func1(x,y):
      x=200
      y=300
  
  x=2
  y=3
  
  func1(x,y)
  
  print x,y #prints 2,3
  </code></pre>
  
  <p>Now if this were C++ I would send them by reference (&amp;) to that function and therefore be able to change their values. So what's the equivilant in Python? and more important, what actually happens when you send objects to function? does Python make new references to these objects?</p>