From 77a404b18950ff7bf9eda6a37fcc6eaa61135b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 6 Jan 2019 00:09:06 +0100 Subject: [PATCH] Dictionary --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 457ae87..1921bb4 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,9 @@ value = .setdefault(key, default) # Same, but also adds default to di = dict() # Initiates a dict from list of key-value pairs. = dict(zip(keys, values)) # Initiates a dict from two lists. = dict.fromkeys(keys [, value]) # Initiates a dict from list of keys. +``` + +```python del [key] # Removes item from dictionary. {k: v for k, v in .items() if k in keys} # Filters dictionary by keys. ```