Find the Runner-Up Score!

  • + 0 comments
    def func_maximo():
        maximo = Lista[0]
        for z in range(len(Lista)):
            if Lista[z] > maximo:
                maximo = Lista[z]
        return maximo
    
    
    if __name__ == '__main__':
    
        #Declarnado Variavel
        n = int(input())
        arr = map(int, input().split())
    
        # Tudo em Lista
        Lista = []
        for x in arr:
            Lista.append(x)
    
        # Maior Numero
        x = func_maximo()
    
        # Removendo o maior numero
        while func_maximo() == x:
            Lista.remove(x)
    
        # Printando o segundo maior numero apos remover
        print(func_maximo())