DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
6+8 =
Submit