card if showdealerhand is false "" print( if showdealerhand print('dealer:'gethandvalue(dealerhand) displaycards(dealerhand else print('dealer???' hide the dealer' first card displaycards([backsidedealerhand[ :] show the player' cards print('player:'gethandvalue(playerhand) displaycards(playerhand def gethandvalue(cards) """returns the value of the cards face cards are worth aces are worth or (this function picks the most suitable ace value"" value numberofaces add the value for the non-ace cards for card in cards rank card[ card is tuple like (ranksuit if rank =' ' numberofaces + elif rank in (' '' '' ')face cards are worth points value + else value +int(ranknumbered cards are worth their number add the value for the aces value +numberofaces add per ace for in range(numberofaces) if another can be added with bustingdo so if value < value + return value def displaycards(cards) """display all the cards in the cards list "" rows [''''''''''the text to display on each row for icard in enumerate(cards) rows[ +___ print the top line of the card if card =backside print card' back rows[ +'|# rows[ +'|### rows[ +'| ## else print the card' front ranksuit card the card is tuple data structure project #