📌  相关文章
📜  如何在嵌套列表中找到最小值python代码示例

📅  最后修改于: 2022-03-11 14:45:18.028000             🧑  作者: Mango

代码示例1
if __name__ == '__main__':
arr = []
for _ in range(int(input())):
    name = input()
    score = float(input())
    arr1 = [name, score]
    arr.append(arr1)
arr.sort(key=lambda x: x[1])
# print(arr)
# print(min(arr,key=lambda x:x[1]))
arr.remove(min(arr,key=lambda x:x[1]))
# print(arr)
minimum = min(arr,key=lambda x:x[1])
# print(minimum[1])
a=[]
minimum = minimum[1]
for i  in arr:
    if(i[1] == minimum):
        a.append(i[0])
a.sort()
for i in a:
    print(i)