Question:

Explain Python’s pass by references Vs pass by value . (or) Explain about Python’s parameter passing mechanism?

Answer:

In Python, by default, all the parameters (arguments) are passed “by reference” to the functions. Thus, if you change the value of the parameter within a function, the change is reflected in the calling function.We can even observe the pass “by value” kind of a behaviour whenever we pass the arguments to functions that are of type say numbers, strings, tuples. This is because of the immutable nature of them.


Keywords:

© 2017 QuizBucket.org