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 poker cards excluding jokers
The deck consists of four suits: clubs, diamonds, hearts, and spades.
Each suit has ranks: Ace, Jack, Queen, and King.
Each card is a combination of a suit and a rank, such as the of clubs."
There are cards per suit, for a total of cards in the deck.
The Jack, Queen, and King are known as face ards
Requirements:
Write a Python program that prints all cards. If a card is a face card, it should be labeled as
such eg FACE CARD
Print all cards with their values:
Numbers to have values equal to their number.
Ace
Jack
Queen
King
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 cards
and successfully identifies face cards.
Find the mean and variance of the values in the deck cards
Create a frequency distribution for the card values eg how many cards out of have the
value etc.
Example Output:
Ace of Clubs,
of Clubs,
of Clubs to of Clubs are omitted
Jack of Clubs FACE CARD,
Queen of Clubs to King of Clubs are omitted
Ace of Diamonds,
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.
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
