Skip to content

Instantly share code, notes, and snippets.

@leopard627
Created February 13, 2020 05:05
Show Gist options
  • Save leopard627/7953d18039a09ed91e029c80eb945488 to your computer and use it in GitHub Desktop.
Save leopard627/7953d18039a09ed91e029c80eb945488 to your computer and use it in GitHub Desktop.
pure python map v1
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