Q:

What is the output of the below python code?

0

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)

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

total answers (1)

Python Interview Questions and Answers

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What is the output of the below python code?... >>
<< What is the output of the below python code?...