Problem p02760 (python)

Fixed submission:
a, b, c = map(int, input().split())
d, e, f = map(int, input().split())
g, h, x = map(int, input().split())
num_count = int(input())
number_list = [0] * num_count
for i in range(num_count):
    number_list[i] = int(input())

bingo_map = [[a, b, c], [d, e, f], [g, h, x]]
bingo_answer = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]

def bingo(bingo_map, number_list):
    for number in number_list:
        for i, bingo_row in enumerate(bingo_map):
            if number in bingo_row:
                for j, bingo_number in enumerate(bingo_row):
                    if bingo_number == number:
                        bingo_answer[i][j] = 1


def check_bingo():
    return (all(bingo_answer[0]) or all(bingo_answer[1]) or all(bingo_answer[2]) or
    all([bingo_answer[0][0], bingo_answer[1][0], bingo_answer[2][0]]) or
    all([bingo_answer[0][1], bingo_answer[1][1], bingo_answer[2][1]]) or
    all([bingo_answer[0][2], bingo_answer[1][2], bingo_answer[2][2]]) or
    all([bingo_answer[0][0], bingo_answer[1][1], bingo_answer[2][2]]) or
    all([bingo_answer[2][0], bingo_answer[1][1], bingo_answer[0][2]]))

bingo(bingo_map, number_list)

if (check_bingo()):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
d, e, f = map(int, input().split())
g, h, i = map(int, input().split())
num_count = int(input())
number_list = [0] * num_count
for i in range(num_count):
    number_list[i] = int(input())

bingo_map = [[a, b, c], [d, e, f], [g, h, i]]
bingo_answer = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]

def bingo(bingo_map, number_list):
    for number in number_list:
        for i, bingo_row in enumerate(bingo_map):
            if number in bingo_row:
                for j, bingo_number in enumerate(bingo_row):
                    if bingo_number == number:
                        bingo_answer[i][j] = 1


def check_bingo():
    return (all(bingo_answer[0]) or all(bingo_answer[1]) or all(bingo_answer[2]) or
    all(bingo_answer[0][0], bingo_answer[1][0], bingo_answer[2][0]) or
    all(bingo_answer[0][1], bingo_answer[1][1], bingo_answer[2][1]) or
    all(bingo_answer[0][2], bingo_answer[1][2], bingo_answer[2][2]) or
    all(bingo_answer[0][0], bingo_answer[1][1], bingo_answer[2][2]) or
    all(bingo_answer[2][0], bingo_answer[1][1], bingo_answer[0][2]))

bingo(bingo_map, number_list)

if (check_bingo()):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
d, e, f = map(int, input().split())
g, h, i = map(int, input().split())
num_count = int(input())
number_list = [0] * num_count
for i in range(num_count):
    number_list[i] = int(input())

bingo_map = [[a, b, c], [d, e, f], [g, h, i]]
bingo_answer = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]

def bingo(bingo_map, number_list):
    for number in number_list:
        for i, bingo_row in enumerate(bingo_map):
            if number in bingo_row:
                for j, bingo_number in enumerate(bingo_row):
                    if bingo_number == number:
                        bingo_answer[i][j] = 1


def check_bingo():
    return (all(bingo_answer[0]) or all(bingo_answer[1]) or all(bingo_answer[2]) or
    all(bingo_answer[0][0], bingo_answer[1][0], bingo_answer[2][0]) or
    all(bingo_answer[0][1], bingo_answer[1][1], bingo_answer[2][1]) or
    all(bingo_answer[0][2], bingo_answer[1][2], bingo_answer[2][2]) or
    all(bingo_answer[0][0], bingo_answer[1][1], bingo_answer[2][2]) or
    all(bingo_answer[2][0], bingo_answer[1][1], bingo_answer[0][2]))

bingo(bingo_map, number_list)

if check_bingo():
    print "Yes"
else:
    print "No"