Didnt understood the key concept

didnt understood the key concept.

Hello @lipika, the key is used to pass on the comparator function, or we can say it allows us to set the condition on which condition we need to sort the data.
So as if we use,
key = lambda x : x[1]
This means we are providing the condition that we need to sort this data based on the names, not based on the marks.
By default it is key = lambda x : x[0]
I hope you understand this. In case if there is any query pls let me know.
And if it is clear to you pls mark it as resolve and feel free to provide the feedback.
Thanks :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.