0 votes
in Python by
What Is “Call By Reference” In Python?

1 Answer

0 votes
by

We use both “call-by-reference” and “pass-by-reference” interchangeably. When we pass an argument by reference, then it is available as an implicit reference to the function, rather than a simple copy. In such a case, any modification to the argument will also be visible to the caller.

This scheme also has the advantage of bringing more time and space efficiency because it leaves the need for creating local copies.

On the contrary, the disadvantage could be that a variable can get changed accidentally during a function call. Hence, the programmers need to handle in the code to avoid such uncertainty.

Related questions

0 votes
asked Aug 29, 2020 in Python by Robindeniel
0 votes
asked Jun 28, 2020 in Python by Robindeniel
...