Answers for "python lambda for loop"

1

python3 lambda

>>> sum = lambda x, y : x + y
>>> sum(3,4)
7
Posted by: Guest on April-04-2020
0

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)
Posted by: Guest on July-13-2021

Python Answers by Framework

Browse Popular Code Answers by Language