Question: Create a deck. Give each player two cards ( chosen randomly using random.choice ) . Display both hands Prompt the player to either hit (
Create a deck.
Give each player two cards chosen randomly using random.choice
Display both hands
Prompt the player to either hit that is draw another card or stay.
If the player hits, keep checking whether the total value of the players cards is equal to If it is then the player wins, and if it is above then the player loses. Display each updated hand after each card draw.
If the player stays, then its the dealers turn to act. If the total value in the dealers hand is less than then they must hit. If it is greater than or equal to but less than or equal to then the dealer must stay. If at any time the dealers total value is above then the dealer busts and the player wins.
Finally, if both the player and dealer scores are below and no one has busted yet, the player with the highest total wins. In the case of a tie, the dealer wins.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
