Buggy python submission (verdict: Runtime Error):

n = int(input())
card_list = list(map(int, input().split()))

alice_point = 0
bob_point = 0

def pick_card(card_list):
    # print(card_list)
    max = 0
    max_index = 0
    for i in range(card_list.__len__()):
        # print('-------', i)
        if card_list[i] > max:
            # print('@', i, ':', max, '<', card_list[i])
            max = card_list[i]
            max_index = i
    
    del card_list[max_index]

    # print('----', card_list)

    return max, card_list

def sort_card(card_list: list):
    return sorted(card_list)

turn = 0
sorted_list = sort_card(card_list)
while turn < n:
    # print('--', turn)
    if turn % 2 == 0:
        # alice_get, remain_list = pick_card(card_list)
        # alice_point += alice_get
        alice_point += sorted_list.pop(turn)
    else:
        # bob_get, remain_list = pick_card(card_list)
        # bob_point += bob_get
        bob_point += sorted_list.pop(turn)

    # card_list = remain_list
    print(alice_point, bob_point, card_list)

    turn += 1

print(alice_point - bob_point)

Fixed submission:

n = int(input())
card_list = list(map(int, input().split()))

alice_point = 0
bob_point = 0

def pick_card(card_list):
    # print(card_list)
    max = 0
    max_index = 0
    for i in range(card_list.__len__()):
        # print('-------', i)
        if card_list[i] > max:
            # print('@', i, ':', max, '<', card_list[i])
            max = card_list[i]
            max_index = i
    
    del card_list[max_index]

    # print('----', card_list)

    return max, card_list

turn = 0
while turn < n:
    # print('--', turn)
    remain_list = []
    if turn % 2 == 0:
        alice_get, remain_list = pick_card(card_list)
        alice_point += alice_get
    else:
        bob_get, remain_list = pick_card(card_list)
        bob_point += bob_get

    card_list = remain_list
    # print(alice_point, bob_point, card_list)

    turn += 1

print(alice_point - bob_point)

Buggy python submission (verdict: Runtime Error):

n = int(input())
card_list = list(map(int, input().split()))

alice_point = 0
bob_point = 0

def pick_card(card_list):
    # print(card_list)
    max = 0
    max_index = 0
    for i in range(card_list.__len__()):
        # print('-------', i)
        if card_list[i] > max:
            # print('@', i, ':', max, '<', card_list[i])
            max = card_list[i]
            max_index = i
    
    del card_list[max_index]

    # print('----', card_list)

    return max, card_list

def sort_card(card_list: list):
    return card_list.sort()

turn = 0
while turn < n:
    # print('--', turn)
    sorted_list = sort_card(card_list)
    if turn % 2 == 0:
        # alice_get, remain_list = pick_card(card_list)
        # alice_point += alice_get
        alice_point += sorted_list.pop()
    else:
        # bob_get, remain_list = pick_card(card_list)
        # bob_point += bob_get
        bob_point += sorted_list.pop()

    card_list = remain_list
    # print(alice_point, bob_point, card_list)

    turn += 1

print(alice_point - bob_point)

Fixed submission:

n = int(input())
card_list = list(map(int, input().split()))

alice_point = 0
bob_point = 0

def pick_card(card_list):
    # print(card_list)
    max = 0
    max_index = 0
    for i in range(card_list.__len__()):
        # print('-------', i)
        if card_list[i] > max:
            # print('@', i, ':', max, '<', card_list[i])
            max = card_list[i]
            max_index = i
    
    del card_list[max_index]

    # print('----', card_list)

    return max, card_list

turn = 0
while turn < n:
    # print('--', turn)
    remain_list = []
    if turn % 2 == 0:
        alice_get, remain_list = pick_card(card_list)
        alice_point += alice_get
    else:
        bob_get, remain_list = pick_card(card_list)
        bob_point += bob_get

    card_list = remain_list
    # print(alice_point, bob_point, card_list)

    turn += 1

print(alice_point - bob_point)