CodeAbbey - Blackjack Counting Here is my solution for CodeAbbey - Blackjack Counting

My code passes all tests on Code Abbey but I think I have some poor implementation specifically with my handling of the Aces in the score but otherwise I think I overall used good practices and design. 

def calculate_player_hand(player_hand_input):
    """Return the score of a player hand"""
    # Variable to hold score for a hand
    total_player_hand_score = 0

    # Dictionary mapping cards to their score value
    card_values = {"2": 2, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7, "8": 8, "9": 9, "T": 10, "J": 10, "K": 10, "Q": 10}

    # Find score of cards except Aces
    for card in player_hand_input:
        if card == "A":
            continue
        else:
            total_player_hand_score += card_values[card]

    # Return player_hand_score not including Ace card(s)
    return total_player_hand_score


# Return the total amount of Aces in a player's hand
def get_aces_count(player_hand_input):
    """Return the count of Aces"""
    return player_hand_input.count("A")


# Read in test cases
test_cases = int(input())

# List to hold all total scores
total_scores = []

# Iterate through test cases
for i in range(test_cases):

    # Read in player hand
    player_hand = input().split()

    # Variable to hold number of Aces in player hand
    player_score_without_aces = calculate_player_hand(player_hand)

    for j in range(get_aces_count(player_hand)):
        if 21 - player_score_without_aces &lt; 11:
            player_score_without_aces += 1
        else:
            player_score_without_aces += 11

    # Rename variable since value of Aces were added
    total_player_score = player_score_without_aces

    # Add total score to total_scores list
    if total_player_score &gt; 21:
        total_scores.append("Bust")
    else:
        total_scores.append(total_player_score)

# Output all total scores
for total_score in total_scores:
    print(total_score, end=" ")


Thank you.
You do not provide a testable function that performs the task of returning the desired answer for a specific test case. It is the ace handling that you intermangled with your test code. The main structure of your program structure should look somewhat like

def calculate_player_hand(player_hand_input):
    #[...]
    return score

def read_tests():
    #[...]
    return testcases, answers

for test, answer in zip(read_tests()):
    assert answer == calculate_player_hand(test)


Completely separate the functionality you want to provide from the tests. even split into different files.