Python Programming - Lambda Functions - Discussion

Discussion Forum : Lambda Functions - General Questions (Q.No. 64)
64.
What is the output of the following code?
numbers = [1, 2, 3, 4, 5]
filtered = list(filter(lambda x: x > 3, numbers))
print(filtered)
[3, 4, 5]
[1, 2, 3]
[4, 5]
[1, 2, 3, 4, 5]
Answer: Option
Explanation:
The filter() function with the lambda filters out numbers less than or equal to 3.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.