Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

harris

# Hello World program in Python
from collections import OrderedDict

matrix = [[11, 12, 5, 2], [15, 6, 10, 8], [10, 8, 12, 5], [12,15,8,6]]
bank = {}
for x in range(len(matrix)):
    for y in range(len(matrix[x])):
        harrisValue = matrix[x][y]
        print "x: %d, y: %d is %d" % (x, y, harrisValue)
        if harrisValue in bank:
            bank[harrisValue].append([x, y])
        else:
            bank[harrisValue] = [[x, y]]

top3HarrisValues = bank.keys()[-3:]
# print(top3HarrisValues)
topCoord = {}
for key in reversed(top3HarrisValues):
    topCoord[key] = bank[key]
    

for key in topCoord:
    print key
    print bank[key]

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.