DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
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
)
Source by softhunt.net #
PREVIOUS
NEXT
Tagged:
#add
#elements
#lists
#map
#lambda
#function
ADD COMMENT
Topic
COMMENT
Name
1+2 =
Submit