हिंदी
तमिलनाडु बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान कक्षा १२

Explain the difference between del and clear( ) in dictionary with an example. - Computer Science

Advertisements
Advertisements

प्रश्न

Explain the difference between del and clear( ) in the dictionary with an example.

अंतर स्पष्ट करें

उत्तर

del() clear()
1. del() keyword is used to delete a particular element of a dictionary 1. The clear() function is used to delete all the elements in a dictionary
2. del() keyword can be used to remove the dictionary 2. The clear() function is used to delete all the elements in a dictionary not a dictionary structure.
3. Example: del Dict[‘MarkT] del Diet 3. Example: Dict.clear()
shaalaa.com
Introduction to List
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 9: Lists, Tuples, Sets and Dictionary - Evaluation [पृष्ठ १६९]

APPEARS IN

सामाचीर कलवी Computer Science [English] Class 12 TN Board
अध्याय 9 Lists, Tuples, Sets and Dictionary
Evaluation | Q 4. | पृष्ठ १६९
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×