Skip to content

Commit 05aeeda

Browse files
committed
Fixed last commit
1 parent e05a22d commit 05aeeda

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@ List
3333
```
3434

3535
```python
36-
sum_of_elements = sum(<list>)
37-
elementwise_sum = [sum(pair) for pair in zip(list_a, list_b)]
38-
sorted_by_second = sorted(<list>, key=lambda el: el[1])
39-
sorted_by_both = sorted(<list>, key=lambda el: (el[1], el[0]))
40-
flattened_list = list(itertools.chain.from_iterable(<list>))
41-
list_of_chars = list(<str>)
42-
product_of_elems = functools.reduce(lambda out, x: out * x, <list>)
43-
no_duplicates = list(set(<list>)) # Does not preserve order
44-
no_duplicates_ordered = list(dict.fromkeys(<list>)) # Preserves order
36+
sum_of_elements = sum(<list>)
37+
elementwise_sum = [sum(pair) for pair in zip(list_a, list_b)]
38+
sorted_by_second = sorted(<list>, key=lambda el: el[1])
39+
sorted_by_both = sorted(<list>, key=lambda el: (el[1], el[0]))
40+
flattened_list = list(itertools.chain.from_iterable(<list>))
41+
list_of_chars = list(<str>)
42+
product_of_elems = functools.reduce(lambda out, x: out * x, <list>)
43+
no_duplicates = list(dict.fromkeys(<list>))
4544
```
4645

4746
```python
@@ -67,7 +66,6 @@ Dictionary
6766
```python
6867
collections.defaultdict(<type>) # Creates a dictionary with default value of type.
6968
collections.defaultdict(lambda: 1) # Creates a dictionary with default value 1.
70-
collections.OrderedDict() # Creates ordered dictionary.
7169
```
7270

7371
```python

0 commit comments

Comments
 (0)