python Python:嵌套列表理解

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python Python:嵌套列表理解相关的知识,希望对你有一定的参考价值。

if __name__ == '__main__':
    n = int(input())
    nlist = [[input(), float(input())] for _ in range(n)]
    second_lowest = sorted(list(set([marks for name, marks in nlist])))[1]
    print('\n'.join([a for a, b in sorted(nlist) if b == second_lowest]))

以上是关于python Python:嵌套列表理解的主要内容,如果未能解决你的问题,请参考以下文章