Python coding out put screen needed A pile of cards contains 5 red cards and 5 black cards. Write a program to simulate removing one card from the pile at a time at random until you remove at least two red cards and three black cards. Show the card that was picked and the contents of the pile of cards at each step. Report the number of total number of cards drawn. Use a list to represent the pile of cards.
Python coding out put screen needed
A pile of cards contains 5 red cards and 5 black cards.
Write a program to simulate removing one card from the pile at a time at random until you remove at least two red cards and three black cards.
Show the card that was picked and the contents of the pile of cards at each step.
Report the number of total number of cards drawn.
Use a list to represent the pile of cards.
Sample Output 1:
Chose: B Pile contains: ['R', 'R', 'R', 'R', 'R', 'B', 'B', 'B', 'B']
Chose: B Pile contains: ['R', 'R', 'R', 'R', 'R', 'B', 'B', 'B']
Chose: R Pile contains: ['R', 'R', 'R', 'R', 'B', 'B', 'B']
Chose: R Pile contains: ['R', 'R', 'R', 'B', 'B', 'B]
Chose: R Pile contains: ['R', 'R', 'B', 'B', 'B']
Chose: B Pile contains: ['R', 'R', 'B', 'B']
Removed 3 red and 3 black cards.
Total number of cards drawn: 6
Sample Output 2:
Chose: B Pile contains: ['R', 'R', 'R', 'R', 'R', 'B', 'B', 'B', 'B']
Chose: R Pile contains: ['R', 'R', 'R', 'R', 'B', 'B', 'B', 'B']
Chose: B Pile contains: ['R', 'R', 'R', 'R', 'B', 'B', 'B']
Chose: R Pile contains: ['R', 'R', 'R', 'B', 'B', 'B']
Chose: B Pile contains: ['R', 'R', 'R', 'B', 'B']
Removed 2 red and 3 black cards.
Total number of cards drawn: 5
Step by step
Solved in 4 steps with 2 images