Python Programming - Lambda Functions - Discussion
Discussion Forum : Lambda Functions - General Questions (Q.No. 56)
56.
What is the output of the following code?
items = ['apple', 'banana', 'cherry']
filtered = list(filter(lambda x: 'a' in x, items))
print(filtered)
Answer: Option
Explanation:
The
filter()
function with the lambda filters items containing the letter 'a'.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers