You are viewing a single comment's thread. Return to all comments →
def total(i,j,m): a = m[i-1][j-1] + m[i-1][j] + m[i-1][j+1] b = m[i][j] c = m[i+1][j-1] + m[i+1][j] + m[i+1][j+1] return a + b + c if __name__ == '__main__': l = [] for _ in range(6): row = list(map(int,input().split())) l.append(row) s = [] for i in range(1,5): for j in range(1,5): s.append(total(i,j,l)) print(max(s))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 11: 2D Arrays
You are viewing a single comment's thread. Return to all comments →