What is the output of the below python code?
def myFun(y): y = [1, 2, 3] # Driver Code lst = [10, 11, 12, 13, 14, 15] myFun(lst); print(lst)
Output: [10, 11, 12, 13, 14, 15]
Explanation,
When we pass a reference and change the received reference to something else, the connection between passed and received parameter is broken.
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Output: [10, 11, 12, 13, 14, 15]
Explanation,
When we pass a reference and change the received reference to something else, the connection between passed and received parameter is broken.
need an explanation for this answer? contact us directly to get an explanation for this answer