Browse Source

Dictionary

pull/10/head
Jure Šorn 5 years ago
parent
commit
314f2981e7
1 changed files with 1 additions and 1 deletions
  1. 2
      README.md

2
README.md

@ -72,8 +72,8 @@ value = <dict>.setdefault(key, default) # Same, but also adds default to di
<dict> = dict(<list>) # Initiates a dict from list of key-value pairs. <dict> = dict(<list>) # Initiates a dict from list of key-value pairs.
<dict> = dict(zip(keys, values)) # Initiates a dict from two lists. <dict> = dict(zip(keys, values)) # Initiates a dict from two lists.
<dict> = dict.fromkeys(keys [, value]) # Initiates a dict from list of keys. <dict> = dict.fromkeys(keys [, value]) # Initiates a dict from list of keys.
{k: v for k, v in <dict>.items() if k in keys} # Filters dictionary by keys.
del <dict>[key] # Removes item from dictionary. del <dict>[key] # Removes item from dictionary.
{k: v for k, v in <dict>.items() if k in keys} # Filters dictionary by keys.
``` ```
### Counter ### Counter

Loading…
Cancel
Save