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

visibility 0 προβολές schedule πριν 5 χρόνια timer 12:25
open_in_new Dailymotion
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 Description<br /><br />clear() Removes all the elements from the dictionary<br />copy() Returns a copy of the dictionary<br />fromkeys() Returns a dictionary with the specified keys and value<br />get() Returns the value of the specified key<br />items() Returns a list containing a tuple for each key value pair<br />keys() Returns a list containing the dictionary's keys<br />pop() Removes the element with the specified key<br />popitem() Removes the last inserted key-value pair<br />setdefault() Returns the value of the specified key. If the key does not exist: insert the key, with the specified value<br />update() Updates the dictionary with the specified key-value pairs<br />values() Returns a list of all the values in the dictionary<br /><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.<br />__________________________________________________