The following code does not execute the for loop for whole size of the list.
The code takes number of players (n) and their score in a list and finds out the SECOND RUNNER UP.
size of list : n
list name : arr
n = int(input())
arr = list(map(int, input().split()))
maximum = max(arr)
print(maximum)
arr.remove(maximum)
for i in arr:
if i == maximum:
arr.remove(maximum)
print(arr)
else:
print("second runner up ", i)
print(max(i))
example:
n : 10
arr: 6 6 6 6 6 6 6 6 6 1
output : 1