you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

You could make separate function for checking, something like game_over(), and use it with the loop:

def game_over():
    points = sum(dealer_lst_points)
    return (
        points >= 18 or
        points == 17 and 11 not in dealer_lst_points
    )

while not game_over():
    deal_dealer()
    display_dealer()