Jan-31-2017, 04:12 PM
Hi
I am attempting to understand lamdas.
output:
Could somebody translate the above lamda to a old style for loop?
I am attempting to understand lamdas.
1 2 3 |
number_list = range ( - 5 , 5 ) less_than_zero = list ( filter ( lambda x: x < 0 , number_list)) print (less_than_zero) |
1 |
[ - 5 , - 4 , - 3 , - 2 , - 1 ] |