Q. What will be the output of the following code ?
rec = {"Name": "Python", "Age":"20"}
r = rec.copy()
print(id(r) == id(rec))
(a) True
(b) False
(c) 0
(d) 1
Answer :-
Option (b) False
(a) True
(b) False
(c) 0
(d) 1
Answer :-
Option (b) False
Why false?
ReplyDeleteBecause id of different or same dictionary is different.
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )