We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Python
  3. Basic Data Types
  4. Nested Lists
  5. Discussions

Nested Lists

Problem
Submissions
Leaderboard
Discussions
Editorial
Tutorial

    You are viewing a single comment's thread. Return to all comments →

  • rohangodge123
    2 months ago+ 0 comments
    if __name__ == '__main__':
    students = []
    marksList = []
    for _ in range(int(input())):
        name = input()
        marks = float(input())
    
        students.append([name, marks])
        marksList.append(marks)
    
    secondLowestScore = sorted(set(marksList))[1]
    
    x = [sname for sname, marks in students if marks == secondLowestScore]
    
    for _ in sorted(x):
        print(_)
    
    0|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy