|
|
@ -33,13 +33,14 @@ List |
|
|
|
``` |
|
|
|
|
|
|
|
```python |
|
|
|
list_of_chars = list(<str>) |
|
|
|
sum_of_elements = sum(<collection>) |
|
|
|
elementwise_sum = [sum(pair) for pair in zip(list_a, list_b)] |
|
|
|
sorted_by_second = sorted(<collection>, key=lambda el: el[1]) |
|
|
|
sorted_by_both = sorted(<collection>, key=lambda el: (el[1], el[0])) |
|
|
|
flattened_list = list(itertools.chain.from_iterable(<list>)) |
|
|
|
list_of_chars = list(<str>) |
|
|
|
product_of_elems = functools.reduce(lambda out, x: out * x, <collection>) |
|
|
|
no_duplicates = list(dict.fromkeys(<list>)) |
|
|
|
``` |
|
|
|
|
|
|
|
```python |
|
|
|