|
|
@ -33,13 +33,13 @@ 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>)) |
|
|
|
product_of_elems = functools.reduce(lambda out, x: out * x, <collection>) |
|
|
|
list_of_chars = list(<str>) |
|
|
|
``` |
|
|
|
|
|
|
|
```python |
|
|
|