Python Programming - Lambda Functions - Discussion

Discussion Forum : Lambda Functions - General Questions (Q.No. 41)
41.
When using the sorted() function with a lambda function to sort a list of strings, how can the sorting be case-insensitive?
Use the case_insensitive=True parameter.
Use the lower() method inside the lambda function.
Use the sorted(case_insensitive=True) syntax.
It is not possible to achieve case-insensitive sorting with lambda functions.
Answer: Option
Explanation:
Using lower() inside the lambda function converts strings to lowercase, achieving case-insensitive sorting.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.