Question: Background: Using Python, your task is to represent a deck of 5 2 poker cards ( excluding jokers ) . The deck consists of four

Background:
Using Python, your task is to represent a deck of 52 poker cards (excluding jokers).
The deck consists of four suits: clubs, diamonds, hearts, and spades.
Each suit has 13 ranks: Ace, 2,3,4,5,6,7,8,9,10, Jack, Queen, and King.
Each card is a combination of a suit and a rank, such as the "2 of clubs."
There are 13 cards per suit, for a total of 413=52 cards in the deck.
The Jack, Queen, and King are known as face ards.
Requirements:
Write a Python program that prints all 52 cards. If a card is a face card, it should be labeled as
such (e.g., FACE CARD).
Print all 52 cards with their values:
Numbers 2 to 10 have values equal to their number.
Ace (A)=1
Jack(J)=11
Queen (Q)=12
King(K)=13
You can decide how to order the suits and ranks, and you may choose to print the names in
lowercase, uppercase, or capitalized format.
You are free to choose meaningful variable names, as long as your program prints all 52 cards
and successfully identifies face cards.
Find the mean and variance of the values in the deck (52 cards).
Create a frequency distribution for the card values (e.g., how many cards out of 52 have the
value 2,3, etc.).
Example Output:
Ace of Clubs, 1
2 of Clubs, 2
...(3 of Clubs to 10 of Clubs are omitted)
Jack of Clubs FACE CARD, 11
...(Queen of Clubs to King of Clubs are omitted)
Ace of Diamonds, 1
...(remaining combinations omitted)
Hints:
Consider defining one list for suits and another for ranks.
Use two nested loops to iterate through the suits and ranks to print all the cards.
Include an if statement to identify face cards. You can either check for Jack, Queen, and King
with an or condition or define a separate list for face cards.
Background: Using Python, your task is to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!