These two dictionaries will act as the players hands. I am also not sure that I am creating two separate dictionaries correctly. Do I need to turn that list back into a dictionary before I can use the deck? I thought I needed to turn the dictionary in createDeck into a list so that I could 'shuffle' (randomize) it and pass it as a parameter to the playGame function. In that case, the ace will be worth 1 point.I want my output to look like this: **NEW ROUND**Ĭurrently, I am receiving 'AttributeError: 'list' object has no attribute 'keys'' as my output, emphasis on line 60. If a player is dealt an ace, the program should decide the value of the card according to the following rule: The ace will be worth 11 points, unless that makes the player’s hand exceed 21 points. (It is possible that both players’ hands will simultaneously exceed 21 points, in which case neither player wins.) The program should repeat until all the cards have been dealt from the deck. When that happens, the other player is the winner.
The program should deal cards to each player until one player’s hand is worth more than 21 points. I am creating a blackjack simulator that has two players.