Skip to content

Instantly share code, notes, and snippets.

@reeddunkle
Last active May 4, 2016 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reeddunkle/4ff0d639155b4f921d6b0c3a925a63e5 to your computer and use it in GitHub Desktop.
Save reeddunkle/4ff0d639155b4f921d6b0c3a925a63e5 to your computer and use it in GitHub Desktop.
Custom Map Method
def my_map(function, iterable):
output = []
for element in iterable:
result = function(element)
output.append(result)
return output
NUMBERS = range(1, 100)
results = my_map(lambda x: x*2, NUMBERS)
print results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment