add info n zip
This commit is contained in:
@ -318,6 +318,8 @@ spread([1,2,3,[4,5,6],[7],8,9]) # [1,2,3,4,5,6,7,8,9]
|
|||||||
```
|
```
|
||||||
### zip
|
### zip
|
||||||
|
|
||||||
|
:information_source: Already implemented via `itertools.zip_longest()`
|
||||||
|
|
||||||
Creates a list of elements, grouped based on the position in the original lists.
|
Creates a list of elements, grouped based on the position in the original lists.
|
||||||
|
|
||||||
Use `max` combined with `list comprehension` to get the length of the longest list in the arguments. Loops for `max_length` times grouping elements. If lengths of `lists` vary `fill_value` is used. By default `fill_value` is `None`.
|
Use `max` combined with `list comprehension` to get the length of the longest list in the arguments. Loops for `max_length` times grouping elements. If lengths of `lists` vary `fill_value` is used. By default `fill_value` is `None`.
|
||||||
|
|||||||
@ -6,6 +6,7 @@ files = os.listdir('snippets')
|
|||||||
codeRe = "```\s*python([\s\S]*?)```"
|
codeRe = "```\s*python([\s\S]*?)```"
|
||||||
for file in files:
|
for file in files:
|
||||||
someFile = open("snippets/" + file)
|
someFile = open("snippets/" + file)
|
||||||
|
print(file)
|
||||||
fileData = someFile.read()
|
fileData = someFile.read()
|
||||||
someFile.close()
|
someFile.close()
|
||||||
originalCode = re.search(codeRe,fileData).group(0)
|
originalCode = re.search(codeRe,fileData).group(0)
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
### zip
|
### zip
|
||||||
|
|
||||||
|
:information_source: Already implemented via `itertools.zip_longest()`
|
||||||
|
|
||||||
Creates a list of elements, grouped based on the position in the original lists.
|
Creates a list of elements, grouped based on the position in the original lists.
|
||||||
|
|
||||||
Use `max` combined with `list comprehension` to get the length of the longest list in the arguments. Loops for `max_length` times grouping elements. If lengths of `lists` vary `fill_value` is used. By default `fill_value` is `None`.
|
Use `max` combined with `list comprehension` to get the length of the longest list in the arguments. Loops for `max_length` times grouping elements. If lengths of `lists` vary `fill_value` is used. By default `fill_value` is `None`.
|
||||||
|
|||||||
Reference in New Issue
Block a user