Question: Write a program in Python to implement the game of 2 1 . Main content The Game For this assignment you will be making a
Write a program in Python to implement the game of
Main content
The Game
For this assignment you will be making a simple version of the game of
Rules:
For each round, the player starts with
You should keep track of the wins and losses for the player
You should repeatedly ask the player if he would like another card until he answers no
Each time the player asks for another card, generate a random number between and Display the players updated score.
If the players card puts him over he busts. Print out that he busted and count this as a loss
Once the player has stopped, the dealer the computer gets to go
The computer starts at and takes cards using the following rule: if the total is less than it takes another card. If it is or higher, it stays.
If the computer gets over it busts and the player wins
If the player has a higher score than the computer, the player wins, and one is added to the players wins
If the player has a lower score, the player loses, and one is added to the players losses
If both the player and the computer have the same score, the game is a tie and no win or loss is recorded
You should print out the score for both the player and computer and who won the round
After each round, you should ask if the player wants to play again. If so play another round. If not, output the final number of wins and losses and end the program.
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
