## Intro to Computer Programming: Python Write a game of Blackjack that functions as follows: Start by dealing two cards at random to the player. Store these cards and the associated values in separate lists. You should remove the two cards from the deck onc

### education

##### Description

Intro to Computer Programming: Python Write a game of Blackjack that functions as follows: Start by dealing two cards at random to the player. Store these cards and the associated values in separate lists. You should remove the two cards from the deck once they have been dealt to the player so they cannot be dealt a second time. Report the player's hand as well as the value of their hand. Next, as the player if they want to "hit" or "stand". "Hitting" means that the player wants another card. "Standing" means that the player is happy with their hand and doesn't want any more cards. If the player chooses to "hit" you should deal them another card (and remove it from the main deck). If their hand is worth 21 points they win the game. If their hand is over 21 points they lose the game (they went "bust").

If they have less than 21 points the process should be repeated (they should be re-prompted to see if they want to "hit" or "stand") If the player chooses to "stand" they will have less than 21 points. Next, you need to give the computer the opportunity to beat the player's score. Begin by dealing two cards to the computer and report the computer's hand and point value. The computer should continually "hit" until one of the following conditions is met: The computer gets 21 points (blackjack) The computer earns more points than the player The computer goes "bust" (over 21 points) If the computer did not go bust then you will need to make a final determination to see who is the winner.

You can do this by seeing which player has more points. Player hand: ['6 of Spades', '8 of Diamonds'] is worth 14 (h)it or (s)tand? h You drew 3 of Clubs Player hand: ['6 of Spades', '8 of Diamonds', '3 of Clubs'] is worth 17 (h)it or (s)tand? h You drew 8 of Clubs Player hand: ['6 of Spades', '8 of Diamonds', '3 of Clubs', '8 of Clubs'] is worth 25 Bust! Player hand: ['2 of Hearts', '5 of Diamonds'] is worth 7 (h)it or (s)tand? h You drew 3 of Hearts Player hand: ['2 of Hearts', '5 of Diamonds', '3 of Hearts'] is worth 10 (h)it or (s)tand? h You drew 5 of Hearts Player hand: ['2 of Hearts', '5 of Diamonds', '3 of Hearts', '5 of Hearts'] is worth 15 (h)it or (s)tand? h You drew 9 of Clubs Player hand: ['2 of Hearts', '5 of Diamonds', '3 of Hearts', '5 of Hearts', '9 of Clubs'] is worth 24 Bust! Computer Wins!

## Related Questions in education category

##### Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.