I'm tring to remove the maximum value from a list that has a repeated maximum value for example: [1,3,6,6,5] the code i use only removes one of the values wihtout removing the other. any ideas why is that happening? the code i use is:
n = int(input())
arr = map(int, input().split())
lst = list (arr)
for i in lst:
if i == max(lst):
del(lst[lst.index(i)])
print (max(lst))