Dict Python
Dict Python
PYTHON
3
DICT
5
METHODS
7
10
In Python - a Dictionary is a data structure
used to store values in the form of key:value
pairs
5
.get()
6 Returns the value associated
with a specified key
7
10
1
5
.update()
6 Updates your dictionary with a
new key:value pair
7
10
1
5
.fromkeys()
6 Creates/Returns a dictionary
based upon pre-specified keys &
7
values
8
10
1
5
.keys()
6 Returns all of the keys from your
dictionary
7
10
1
5
.values()
6 Returns all of the values from
your dictionary
7
10
1
5
.items()
6 Returns all of the key:value pairs
from your dictionary (each
7
returned as a tuple)
8
10
1
5
.pop()
6 Removes (and returns) the key
and value for a specified key
7
10
1
5
.popitem()
6 Removes (and returns) the most
recently added key:value pair
7
10
1
5
.copy()
6 Returns a copy of your dictionary
7
10
1
5
.clear()
6 Removes all elements of your
dictionary
7
10
Want to land an
incredible role in the
exciting, future-proof,
and lucrative field of
Data Science?
"I had over 40 interviews without an offer.
After DSI I quickly got 7 offers including one
at KPMG and my amazing new role at
Deloitte!" - Ritesh