factorial

This commit is contained in:
Rohit Tanwar
2018-01-27 11:03:02 +05:30
parent 94a4c53868
commit b5a1fa18ba
17 changed files with 31 additions and 91 deletions

View File

@ -6,8 +6,7 @@ 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`.
```python
```python
def zip(*args, fillvalue=None):
max_length = max([len(arr) for arr in args])
@ -17,7 +16,6 @@ def zip(*args, fillvalue=None):
args[k][i] if i < len(args[k]) else None for k in range(len(args))
])
return result
```
``` python