Page 1 of 1

What will be the output of the following Python program?

Posted: Wed Jul 13, 2022 7:44 pm
by answerhappygod
def foo(x):
x[0] = ['def']
x[1] = ['abc']
return id(x)
q = ['abc', 'def']
print(id(q) == foo(q))
a) Error
b) None
c) False
d) True