M
Marcello Pietrobon
Hello,
My background is C++
I would like to know for sure if it is possible to pass a value by
reference to a function AND having it changed by the function itself
def changeValue( text ):
text = 'c'
print text
return
'a'
Question 1)
I guess that in Python ( differently than in C++) somehow txt is passed
by reference even if its value is not changed.
Is this true ?
Question 2)
How can I define a function that changes the value of txt ( without
having to return the changed value ) ?
Question 3)
Is there some documentation talking extensively about this ?
Thank you,
Marcello
My background is C++
I would like to know for sure if it is possible to pass a value by
reference to a function AND having it changed by the function itself
def changeValue( text ):
text = 'c'
print text
return
'a'
Question 1)
I guess that in Python ( differently than in C++) somehow txt is passed
by reference even if its value is not changed.
Is this true ?
Question 2)
How can I define a function that changes the value of txt ( without
having to return the changed value ) ?
Question 3)
Is there some documentation talking extensively about this ?
Thank you,
Marcello