What is the output of the following code ?
def foo(p): p[0] = 1 q = [0] foo(q) print(q)
The arguments in python passed as reference,Here list is passed as reference. So changing an inner object will change the list
Comment here: