From bb4b249fe9e9fb6c4bc6a1088df3bbe7c137e4b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 18 Apr 2018 01:50:14 +0200 Subject: [PATCH] Dict --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d43cb55..cde6cf9 100644 --- a/README.md +++ b/README.md @@ -43,18 +43,18 @@ Dictionary .update() ``` -```python ->>> a = [('x', 4), ('y', 5)] ->>> dict(a) -{'x': 4, 'y': 5} -``` - ```python collections.defaultdict() # Creates a dictionary with default values. dict(zip(keys, values)) # Initiates a dict from two lists. {k: v for k, v in .items() if k in } # Filters a dict by keys. ``` +```python +>>> a = [('x', 4), ('y', 5)] +>>> dict(a) +{'x': 4, 'y': 5} +``` + ### Counter ```python >>> from collections import Counter