Skip to content

Instantly share code, notes, and snippets.

@vinaykudari
Created July 21, 2018 19:50
Show Gist options
  • Save vinaykudari/fa5c526d0f04bbcb540a2fa131377906 to your computer and use it in GitHub Desktop.
Save vinaykudari/fa5c526d0f04bbcb540a2fa131377906 to your computer and use it in GitHub Desktop.
Map function
list_a = [1, 2]
list_b = [10, 20]
def add(a,b):
return a+b
m1 = map(add,list_a,list_b) #using normal function
m2 = map(lambda x, y: x + y, list_a, list_b) #using lambda function
>> print(list(m1))
[11,22]
>> print(list(m2))
[11,22]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment