Apply new format to snippets and template

This commit is contained in:
Angelos Chalaris
2020-09-15 16:13:06 +03:00
parent 39d3711994
commit a9aeadad64
117 changed files with 170 additions and 175 deletions

View File

@ -5,11 +5,10 @@ tags: list,math,advanced
Merges two or more lists into a list of lists, combining elements from each of the input lists based on their positions.
Use `max` combined with list comprehension to get the length of the longest list in the arguments.
Use `range()` in combination with the `max_length` variable to loop as many times as there are elements in the longest list.
If a list is shorter than `max_length`, use `fill_value` for the remaining items (defaults to `None`).
[`zip()`](https://docs.python.org/3/library/functions.html#zip) and [`itertools.zip_longest()`](https://docs.python.org/3/library/itertools.html#itertools.zip_longest) provide similar functionality to this snippet.
- Use `max` combined with list comprehension to get the length of the longest list in the arguments.
- Use `range()` in combination with the `max_length` variable to loop as many times as there are elements in the longest list.
- If a list is shorter than `max_length`, use `fill_value` for the remaining items (defaults to `None`).
- [`zip()`](https://docs.python.org/3/library/functions.html#zip) and [`itertools.zip_longest()`](https://docs.python.org/3/library/itertools.html#itertools.zip_longest) provide similar functionality to this snippet.
```py
def merge(*args, fill_value=None):