Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Lambda Functions using for loop

list1 = [1,2,3,4,5]
list2 = []

for i in list1:
    f = lambda i: i /2
    list2.append(f(i))
print(list2)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Lambda #Functions #loop
ADD COMMENT
Topic
Name
6+8 =