Page 9 - Lesson Note - DICTIONARIES
P. 9
Using (=) operator also a copy of the dictionary can be created,
Dictionary is mutable, modification any one here is modifies the main content
Deleting dictionary items
Function Description
clear() removes all items of the dictionary and make the dictionary an empty dictionary
pop() removes and returns the dictionary element associated to passed key
popitem() removes and returns the last inserted dictionary element
del deletes a key( and corresponding value) from the dictionary/ without parameter
deletes whole dictionary
clear() method
clears all the elements of a dictionary, returns no value, makes the dictionary empty
pop(), popitem()
D.pop(k) → removes specified key and return the corresponding value
D.popitem() → Remove and return last (key, value) pair as a 2 element tuple.