# 1 1 # 1 0 9 8 7 6 5 4 3 2 1 #[1,2,3,4,4,5,6,7,8,9,9] data = [7,1,9,5,4,2,6,4,3,9,8] n = 3 dataCopy = data.copy() for nn in range(0,n): max = dataCopy[0] maxIndex = 0 dataSize = len(dataCopy) for i in range(1,dataSize): if dataCopy[i] > max: max = dataCopy[i] maxIndex = i print('max ({0}) at index {2} = {1}'.format(nn+1, max, maxIndex)) del dataCopy[maxIndex] print('{0}-th max = {1}'.format(nn+1,max))