Last active
May 4, 2016 20:07
-
-
Save reeddunkle/4ff0d639155b4f921d6b0c3a925a63e5 to your computer and use it in GitHub Desktop.
Custom Map Method
This file contains 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 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