Travis build: 187
This commit is contained in:
@ -1176,7 +1176,7 @@ Loop for `max_length` times grouping elements.
|
||||
If lengths of `lists` vary, use `fill_value` (defaults to `None`).
|
||||
|
||||
```py
|
||||
def zip(*args, fillvalue=None):
|
||||
def zip(*args, fill_value=None):
|
||||
max_length = max([len(lst) for lst in args])
|
||||
result = []
|
||||
for i in range(max_length):
|
||||
|
||||
@ -1221,7 +1221,7 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "8c0dea46f260c7edfa363a0a295683d858c2011c9220b2d4fc53025a684388f0"
|
||||
"hash": "7741a05775275c2b463f0a110d70b130393857f2c391e571ecc1dcd4c0e94809"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -1606,7 +1606,7 @@
|
||||
"fileName": "zip.md",
|
||||
"text": "Creates a list of elements, grouped based on the position in the original lists.\n\n\nUse `max` combined with `list comprehension` to get the length of the longest list in the arguments. \nLoop for `max_length` times grouping elements. \nIf lengths of `lists` vary, use `fill_value` (defaults to `None`). \n\n",
|
||||
"codeBlocks": {
|
||||
"code": "def zip(*args, fillvalue=None):\n max_length = max([len(lst) for lst in args])\n result = []\n for i in range(max_length):\n result.append([\n args[k][i] if i < len(args[k]) else fillvalue for k in range(len(args))\n ])\n return result",
|
||||
"code": "def zip(*args, fill_value=None):\n max_length = max([len(lst) for lst in args])\n result = []\n for i in range(max_length):\n result.append([\n args[k][i] if i < len(args[k]) else fillvalue for k in range(len(args))\n ])\n return result",
|
||||
"example": "zip(['a', 'b'], [1, 2], [True, False]) # [['a', 1, True], ['b', 2, False]]\nzip(['a'], [1, 2], [True, False]) # [['a', 1, True], [None, 2, False]]\nzip(['a'], [1, 2], [True, False], fill_value = '_') # [['a', 1, True], ['_', 2, False]]"
|
||||
},
|
||||
"tags": [
|
||||
@ -1616,7 +1616,7 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "8c0dea46f260c7edfa363a0a295683d858c2011c9220b2d4fc53025a684388f0"
|
||||
"hash": "7741a05775275c2b463f0a110d70b130393857f2c391e571ecc1dcd4c0e94809"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user