Last active
December 29, 2020 06:16
-
-
Save vkuberan/ee00d56ea05f97f5d24b955a43935e33 to your computer and use it in GitHub Desktop.
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 squared(numbers): | |
return [(i * i) for i in numbers] | |
def high_order_func_demo(transform, numbers): | |
return transform(numbers) | |
numbers = [1, 2, 3, 4, 5] | |
result = high_order_func_demo(squared, numbers) | |
print(numbers) | |
print(result) | |
# [1, 2, 3, 4, 5] | |
# [1, 4, 9, 16, 25] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Results:
[1, 2, 3, 4, 5]
[1, 4, 9, 16, 25]