Question: PYTHON ONLY!!Write a program to create a list of ranks and another list of suits to create another list consisting of the 52 cards in
PYTHON ONLY!!Write a program to create a list of ranks and another list of suits to create another list consisting of the 52 cards in a deck of cards.
Use nested loops. The cards are assigned their ranks in the outer loop and their suits in the inner loop.
The first for statement iterates through the items in ranks until every item has been accessed. At each iteration of the outer loop, the second for statement iterates through the items of suits until all of those items have been accessed.
Each pass of the inner loop appends the name of a card to another list, deckofCards.
Use another for loop to print all the cards in a deck.10 points Next: Ask the user to input the number of cards in a hand (say n). Create another list called hand that will represent an n card hand. To create the hand list, ask the user to repeatedly pick a card by selecting a number between 0 and 51. Print the hand list. (10 points)
Next: Improve the input by requiring a user to pick five different cards. (10 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
