Modifying function arguments

Viewed 21927

Sorry if this is a dumb question, but I've looked for a while and not really found the answer.

If I'm writing a python function, for example:

def function(in1, in2):
    in1=in1+1
    in2=in2+1

How do I make these changes stick?

I know why they dont, this has been addressed in many answers, but I couldn't find an answer to the question of how to actually make them do so. Without returning values or making some sort of class, is there really no way for a function to operate on its arguments in a global sense?

I also want these variables to not be global themselves, as in I want to be able to do this:

a=1
b=2
c=3
d=4
function(a,b)
function(c,d)

Is this just wishful thinking?

3 Answers
Related