Write a simulation program called war.py that plays 10000 games of War between two players, each with regular 52 card decks. Record in a list the number of games that are tied (i.e. each player has 52 cards at the end of the game), the number where one player wins by 2 (i.e. one player has 51 cards and the other 53 cards at the end), by 4, by 6, etc. (noting that the card differential is always a multiple of 2), and print out there results at the end of the simulation. Specifically, print out to the screen a series of number pairs, the first is the difference in the number of cards, following by the fraction of times that occurs, e.g. 0 0.11 2 0.20 4 0.19 6 0.15

Solved
Show answers

Ask an AI advisor a question