You are viewing a single comment's thread. Return to all comments →
second_highest = sorted(list(set([marks for name, marks in marksheet])))[1]
can you explain this line , i didn't understand why a list has to be created to be sorted, we can place a collection in sorted method.
Seems like cookies are disabled on this browser, please enable them to open this website
Nested Lists
You are viewing a single comment's thread. Return to all comments →
second_highest = sorted(list(set([marks for name, marks in marksheet])))[1]
can you explain this line , i didn't understand why a list has to be created to be sorted, we can place a collection in sorted method.