Last active
December 29, 2020 06:22
-
-
Save vkuberan/58563bb41262994010053d357ae0f49a 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
# Right Implementation | |
def cubed(n): | |
return [(x * x * x) for x in n] | |
# Wrong Implementation and it will trigger an error | |
def postive_to_negative(n, j): | |
return [(x * x * x) for x in n] | |
numbers = [1, 2, 3, 4, 5] | |
print(high_order_func_demo(cubed, numbers)) | |
print(high_order_func_demo(postive_to_negative, numbers)) | |
# [1, 8, 27, 64, 125] | |
# : postive_to_negative() missing 1 required positional argument: 'j' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment