title: I'm currently writing a black jack game and I am having problems with passing my code onto the "calculating_scores" function
body: <p>Can anyone help me fix my issue with getting my code to pass onto the calculating_scores function without my coding wanting to loop back up every time I enter something into the <code>another_card = input(&quot;Type 'y' if you'd like another card:\n&quot;)</code></p>
  <pre><code> def play():
          global game_continue
          user_cards = []
          dealer_cards = []
          for _ in range(2):
              user_cards.append(deal_cards())
              dealer_cards.append(deal_cards())
      
          total_user = sum(user_cards)
          print(f&quot;You got the cards: {user_cards}, giving you a total of {total_user}\n&quot;)
          print(f&quot;The dealer got the card: {dealer_cards[0]}\n&quot;)
      
          while game_continue:
              another_card = input(&quot;Type 'y' if you'd like another card:\n&quot;)
              if another_card == &quot;yes&quot; or another_card == &quot;y&quot;:
                  user_cards.append(deal_cards())
                  new_user_total = sum(user_cards)
                  print(f&quot;You have the cards, {user_cards}, giving you a total of: {new_user_total}&quot;)
                  dealer_total = dealer_cards[0] + dealer_cards[1]
                  print(f&quot;The dealers second card was {dealer_cards[1]}, giving him a total of {dealer_total}&quot;)
                  calculating_scores(card_list=user_cards)
              elif another_card == &quot;no&quot; or another_card == &quot;n&quot;:
                  game_continue = False
                  dealer_total = dealer_cards[0] + dealer_cards[1]
                  print(f&quot;The second dealers card was a {dealer_cards[1]} giving him a total of {dealer_total}&quot;)
                  calculating_scores(card_list=user_cards)
              else:
                  print(&quot;Sorry this is an invalid option!&quot;)
              # 10:16pm altering the arguments called after calculating_score to make the program properly function
      
      
      def calculating_scores(card_list):
          if sum(card_list) == 21:
              return &quot;Dealer won blackjack!&quot;
          if 11 in card_list and sum(card_list) &gt; 21:
              card_list.remove(11)
              card_list.append(1)
          return sum(card_list)
  </code></pre>