Python Programming - Dictionary methods in python(clear(), copy(), fromkeys(), get(), items() etc.

Python Programming - Dictionary methods in python(clear(), copy(), fromkeys(), get(), items() etc.

A dictionary is a collection which is unordered, changeable and indexed. In Python dictionaries are written with curly brackets, and they have keys and values.br In this video we see dictionary function in python .br br Method Descriptionbr br clear() Removes all the elements from the dictionarybr copy() Returns a copy of the dictionarybr fromkeys() Returns a dictionary with the specified keys and valuebr get() Returns the value of the specified keybr items() Returns a list containing a tuple for each key value pairbr keys() Returns a list containing the dictionary's keysbr pop() Removes the element with the specified keybr popitem() Removes the last inserted key-value pairbr setdefault() Returns the value of the specified key. If the key does not exist: insert the key, with the specified valuebr update() Updates the dictionary with the specified key-value pairsbr values() Returns a list of all the values in the dictionarybr br br br If you found this video valuable, give it like br If you know someone who needs to see it, share it.br Add it to a playlist if you want to watch it later.


User: Programmer Dushyant

Views: 0

Uploaded: 2020-07-06

Duration: 12:25