def play_round(): global total_deck global dealers_deck total_deck = 0 # Reset total_deck for each round dealers_deck = 0 dealers_deck += dealer_start() print() total_deck += deal_card() total_deck += deal_card() print() print(f"Your total: {total_deck}") while total_deck <= 21: hop = input("Do you want to [h]it or [p]ass? ").lower() if hop == 'h': total_deck += deal_card() print() print(f"Your total: {total_deck}") elif hop == 'p': if dealers_deck < 17: dealers_deck = dealer_deal(dealers_deck) print(f"Dealer's total: {dealers_deck}") if dealers_deck > 21 or total_deck > dealers_deck: print("You won!") elif total_deck == dealers_deck: print("It's a tie!") else: print("You lose!") break else: print("Invalid input! Please choose 'h' or 'p'.") else: print("You busted! Game over.") end_game()