Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Adding two lists using map() and Lamda Function

# welcome to softhunt.net
# Add two lists using map and lambda

num1 = [10, 10, 10, 10]
num2 = [10, 30, 50, 70]

ans = map(lambda x, y: x + y, num1, num2)
print(list(ans))
Comment

how to add the elements of two lists using map and lambda function

num = [1,2,3]
num1 = [5,6,7]
res = list(map(lambda x, y: x+y, num, num1))
print("Summation =",res)
Comment

PREVIOUS NEXT
Code Example
Python :: python identify image mode 
Python :: pd calculations between columns 
Python :: python - subtracting dictionary values 
Python :: Reducing noise on Data 
Python :: turtle screen 
Python :: how to add items to a set in python 
Python :: scrape pdf out of link 
Python :: Python use number twice without variable 
Python :: pass query params django template 
Python :: how to find the no of user for a wifi using python for ubuntu 
Python :: Iterate through string in python using for loop 
Python :: ipywidgets label text color 
Python :: aiohttp specify app IP 
Python :: pandas series to dataframe index as column 
Python :: a softmax function 
Python :: python selenium teardown class 
Python :: python regex find single character 
Python :: pygame get surface region 
Python :: delete first element of dictionary python 
Python :: binary tree python 
Python :: python immutable dataclass 
Python :: python all list items to lower case 
Python :: list in python 3 
Python :: txt to image python 
Python :: python not equal to 
Python :: python pytest no coverage on failure 
Python :: closure python 
Python :: python use getcontext 
Python :: python dictionary with dot notation 
Python :: find each geometry overlap python 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =