You should know that what you're trying to do is not possible.
In Python, there are values and there are names (variables).
An assignment makes a name refer to a value. It follows, that the same value can have multiple names.
Function parameters are names, that are local to that function. Assigning to them cannot make a different name magically refer to a different value. All it does is "bind" the local name to a different value.
Now, there are mutable values, and there are immutable values. Remember, different names can refer to the same value. If you change the value, rather than bind a name to a different value, all other names that are bound to that value will see the change, too.
aandbvariables change scope due to the function. Thereforeaandbswitch only within the scope ofxchg. You'd have to return a value and assign that value to a variable if you wanted this to work. For future information, this has to do with mutability of datatypes in python.