Created
September 5, 2019 05:49
-
-
Save MishraKhushbu/7836b0b29741d1413d546e3b4928383b to your computer and use it in GitHub Desktop.
PYTHON_DICTIONARY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dictionary Methods | |
Python has a set of built-in methods that you can use on dictionaries. | |
url : https://www.w3schools.com/python/python_dictionaries.asp | |
Method Description | |
clear() ===>Removes all the elements from the dictionary e | |
copy() ====>Returns a copy of the dictionary | |
fromkeys()===>Returns a dictionary with the specified keys and values | |
get() ====>Returns the value of the specified key | |
items()====>Returns a list containing the a tuple for each key value pair | |
keys() ====>Returns a list containing the dictionary's keys | |
pop()=====>Removes the element with the specified key | |
popitem()====>Removes the last inserted key-value pair | |
setdefault()====>Returns the value of the specified key. If the key does not exist: insert the key, with the specified value | |
update()====>Updates the dictionary with the specified key-value pairs | |
values()====>Returns a list of all the values in the dictionary |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment