InterviewSolution
Saved Bookmarks
| 1. |
How are arguments passed by value or by reference in python? |
Answer»
In PYTHON, arguments are passed by reference, i.e., reference to the actual object is passed. def appendNumber(arr): arr.append(4)arr = [1, 2, 3]PRINT(arr) #Output: => [1, 2, 3]appendNumber(arr)print(arr) #Output: => [1, 2, 3, 4] |
|