निम्नलिखित में से कौन शब्दकोश में key=”tiger” के लिए कुंजी-मान को हटा देगा?
Which of the following will delete key-value pair for key=”tiger” in dictionary ?
dic={“lion”:”wild”,”tiger”:”wild”,”cat”:”domestic”,“dog”.”domestic”} A
del dic[“tiger”]
B
dic[“tiger”].delete()
C
delete(dic.[“tiger”])
D
del(dic.[“tiger”])
Explanation
To delete the key-value pair for "tiger" in the dictionary, you use the del statement:
del dic["tiger"]
This removes the key "tiger" and its value from the dictionary.
Correct answer: (A) del dic["tiger"].
Correct Answer: A) del dic[“tiger”]