Could anyone answer this question? In relation to Python. It is a question in some computing homework i have and i can't quite understand it
A reference type parameter does not contain its data, but a reference to its data. Whereas, a value type parameter contains its data directly.
Passing a parameter by value is like copying. The value in the argument (the function call) is copied into the function's local environment. The function cannot see the native value, only the copy of it. Nothing outside the function will change.
Passing a parameter by reference is like sharing between inside the function and outside. The same object is in play. This would be a list or dictionary, or a function, as these are all reference objects. The values contained therein must be referenced.
dictionary['item'] are references to a contained value (or object).
thank you so much!!!
thank you, this is really helpful