Q. What will be the output of the following code snippet?
rec = {"Name" : "Python", "Age" : "20", "Addr" : "NJ", "Country":"USA"}
id1 = id(rec)
del rec
rec = {"Name" : "Python", "Age" : "20", "Addr" : "NJ", "Country" : "USA" }
id2 = id(rec)
print(id1 == id2)
(a) True
(b) False
(c) 1
(d) Exception
Answer =
Option: (a) is correct.
Why true?
ReplyDeleteBecause ids are same.
DeletePlease give me more explanation
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )