if __name__ == '__main__':
students = {}
for _ in range(int(input())):
name = input()
score = float(input())
seq = {name: score}
students.update(seq)
a = min(students, key=students.get)
for key, value in students.items():
while a == min(students, key=students.get):
del students[min(students, key=students.get)]
print(students)
In the above code, I would like to remove the minimum valued element in the dictionary.
I am able to remove a single minimum element from the dictionary. But I want to remove all such minimum valued elements if there are more than one same minimum valued elements in the dictionary.