Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

use lambda with map in python

# Double all numbers using map and lambda
  
numbers = (1, 2, 3, 4)
result = map(lambda x: x + x, numbers)
print(list(result))

# output :-

# 1 + 1 = 2 / 2 + 2 = 4 / 3 + 3 = 6 / 4 + 4 = 8

[2, 4, 6, 8]
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #lambda #map #python
ADD COMMENT
Topic
Name
6+3 =