Python Programming - Lambda Functions - Discussion

Discussion Forum : Lambda Functions - General Questions (Q.No. 57)
57.
How can a lambda function be used with the min() function to find the minimum length string in a list of strings?
min(strings, key=len)
min(strings, lambda x: x)
min(strings, lambda x: len(x))
min(strings, key=lambda x: x)
Answer: Option
Explanation:
The key parameter is used to specify the lambda function that calculates the length of each string.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.