File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -63,17 +63,17 @@ Dictionary
63
63
```
64
64
65
65
``` python
66
- value = < dict > .get(key, default = None ) # Returns default if key does not exist.
67
- value = < dict > .setdefault(key, default = None ) # Same, but also adds default to dict.
68
- < dict > = collections.defaultdict(< type > ) # Creates a dictionary with default value of type.
69
- < dict > = collections.defaultdict(lambda : 1 ) # Creates a dictionary with default value 1.
66
+ value = < dict > .get(key, default = None ) # Returns default if key does not exist.
67
+ value = < dict > .setdefault(key, default = None ) # Same, but also adds default to dict.
68
+ < dict > = collections.defaultdict(< type > ) # Creates a dictionary with default value of type.
69
+ < dict > = collections.defaultdict(lambda : 1 ) # Creates a dictionary with default value 1.
70
70
```
71
71
72
72
``` python
73
- < dict > .update(< dict > ) # Or: dict_a = {**dict_a, **dict_b}.
74
- < dict > = dict (< collection> ) # Initiates a dict from coll. of key-value pairs.
75
- < dict > = dict (zip (keys, values)) # Initiates a dict from two collections.
76
- < dict > = dict .fromkeys(keys [, value]) # Initiates a dict from collection of keys.
73
+ < dict > .update(< dict > ) # Or: dict_a = {**dict_a, **dict_b}.
74
+ < dict > = dict (< collection> ) # Initiates a dict from coll. of key-value pairs.
75
+ < dict > = dict (zip (keys, values)) # Initiates a dict from two collections.
76
+ < dict > = dict .fromkeys(keys [, value]) # Initiates a dict from collection of keys.
77
77
```
78
78
79
79
``` python
You can’t perform that action at this time.
0 commit comments