Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created January 18, 2021 16:00
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 BetterProgramming/b130b452a8e88ee3b6895d09f6a4ac2b to your computer and use it in GitHub Desktop.
Save BetterProgramming/b130b452a8e88ee3b6895d09f6a4ac2b to your computer and use it in GitHub Desktop.
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