Nested Lists from HackerRank
I'd recommend separating the logic of getting the user input from the logic of building and sorting the nested list.
Your code doesn't build a nested list in a way that's useful for solving the problem; I think what you want is a list of lists of names, where each list of names corresponds to a grade.
Any time you want to group things into buckets (e.g. all the names that go with a grade), it's a good time to use a dictionary!
Using list comprehensions is frequently a good way to express a loop in a shorter way.
Type annotations make it easier to keep track of what your code is doing (and they let you use mypy to catch bugs).


Here's my solution that uses a separate function to build the nested list, using a dictionary as an intermediate step to collect all the names for a given grade.  Note that the type annotations tell you exactly where the names (strings) and grades (floats) are going at each step!

from collections import defaultdict
from typing import Dict, List, Tuple

def build_grade_lists(grades: List[Tuple[str, float]]) -&gt; List[List[str]]:
    """
    Given a list of (name, grade) tuples, return a list of names for each grade.
    Each list is sorted, i.e.:
        the top level list is sorted from lowest to highest grade
        each list of names is sorted alphabetically
    """
    grade_lists: Dict[float, List[str]] = defaultdict(list)
    for name, grade in grades:
        grade_lists[grade].append(name)
    return [sorted(grade_lists[grade]) for grade in sorted(list(grade_lists.keys()))]

if __name__ == '__main__':
    scorecard = [(input(), float(input())) for _ in range(int(input()))]
    for name in build_grade_lists(scorecard)[1]:
        print(name)