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 →

  • a_harshadayini
    2 months ago+ 0 comments

    if name == 'main': result=list() marks=list() for _ in range(int(input())): name = input() score = float(input()) result.append([name,score]) #nested list marks.append(score)

    marks=sorted(set(marks)) second_lowest = marks[1]

    names=[val[0] for val in result if second_lowest==val[1] ] (or)

    names=[name for name,score in result if second_lowest==score ] names.sort() for i in names: print(i)

    0|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy