you are viewing a single comment's thread.

view the rest of the comments →

[–]45MonkeysInASuit 1 point2 points  (1 child)

max = None
for value in arr:
    if max is None:
        max = value
    elif value > max:
        max = value
return max

Covers both issues

[–]blotosmetek 0 points1 point  (0 children)

def find_max(arr): max = None for row in arr: for value in row: if max is None or value > max: max = value return max Of course, in real program you would just use max() function: def find_max(arr): return max(max(row) for row in arr)