Created
February 13, 2020 05:05
-
-
Save leopard627/7953d18039a09ed91e029c80eb945488 to your computer and use it in GitHub Desktop.
pure python map v1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def myfunc(func, *args): | |
res = [] | |
for args in zip(*args): | |
res.append(func(*args)) | |
return res | |
myfunc(abs, [-1, 2, 3]) | |
>> [1, 2, 3] | |
myfunc(abc, [-1, -2, -3] | |
>> [1, 2, 3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment