Question Description
In Chapter 18 of the Think Python book, a card game is written in Python:
http://thinkpython2.com/code/Card.py
The card game resembles a game of Poker, but it’s not necessary to understand how to play poker to do this assignment. The game draws 5 cards from a deck of cards, sorts the cards, and displays them. For the midterm review, add a function or class to evaluate a hand of cards. You may add functionality to the Midterm Pre-Defined classes like Card, Deck or Hand to support your evaluation.
Cards have 4 suites [club, diamond, heart, spade] and have 13 cards per suit [ Ace=1, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack=11, Queen=12, King=13] where the Ace can either be the lowest or highest card. To evaluate a hand of cards, add the denominations of the cards together and produce a sum. For example:
Ace of Clubs = 1
3 of Clubs = 3
Jack of Diamonds = 11
Queen of Diamonds = 12
8 of Spades = 8
Sum : 1 + 3 + 11 + 12 + 8 = 35
So the Ace of Clubs + 3 of Clubs + Jack of Diamonds + Queen of Diamonds + 8 of Spades evaluates to 35. Of course other hands could also evaluate to 35 and in that case, the suits have a precedence with clubs being the lowest to spades being the highest. This precedence does not have to be applied to your evaluation.
In Chapter 18 of the Think Python book, a card game is written in Python:http://thinkpython2.com/code/Card.pyThe card game resembles a game of Poker, but it’s not necessary to understand how to play poker to do this assignment. The game draws 5 cards from a deck of cards, sorts the cards, and displays them. For the midterm review, add a function or class to evaluate a hand of cards. You may add functionality to the Midterm Pre-Defined classes like Card, Deck or Hand to support your evaluation. Cards have 4 suites [club, diamond, heart, spade] and have 13 cards per suit [ Ace=1, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack=11, Queen=12, King=13] where the Ace can either be the lowest or highest card. To evaluate a hand of cards, add the denominations of the cards together and produce a sum. For example: Ace of Clubs = 1 3 of Clubs = 3 Jack of Diamonds = 11 Queen of Diamonds = 12 8 of Spades = 8 Sum : 1 + 3 + 11 + 12 + 8 = 35So the Ace of Clubs + 3 of Clubs + Jack of Diamonds + Queen of Diamonds + 8 of Spades evaluates to 35. Of course other hands could also evaluate to 35 and in that case, the suits have a precedence with clubs being the lowest to spades being the highest. This precedence does not have to be applied to your evaluation.