Created
January 18, 2021 16:00
-
-
Save BetterProgramming/b130b452a8e88ee3b6895d09f6a4ac2b 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 multiply(x,y): | |
return x*y | |
num1=[1,2,3,4] | |
num2=[11,22,33,44] | |
result=map(multiply,num1,num2) | |
#Returns a map object | |
print (result)#Output:<map object at 0x00FDEC10> | |
#converting map object to list() constructor. | |
print (list(result))#Output:[11, 44, 99, 176] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment