Skip to content

Instantly share code, notes, and snippets.

@abhinavkorpal
Created April 8, 2017 07:50
Show Gist options
  • Save abhinavkorpal/23da31e34af17b3998e0f896b74ffb6f to your computer and use it in GitHub Desktop.
Save abhinavkorpal/23da31e34af17b3998e0f896b74ffb6f to your computer and use it in GitHub Desktop.
Nested Lists
marksheet = []
for _ in range(0,int(input())):
marksheet.append([input(), float(input())])
second_highest = sorted(list(set([marks for name, marks in marksheet])))[1]
print('\n'.join([a for a,b in sorted(marksheet) if b == second_highest]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment