Question: The file DeckOfCardsList.dat is a pickled binary file containing a list of the 52 cards in an ordinary deck of playing cards. The following program
The file DeckOfCardsList.dat is a pickled binary file containing a list of the 52 cards in an ordinary deck of playing cards. The following program randomly selects five cards from the deck.
import random import pickle infile = open("DeckOfCardsList.dat", 'rb') deckOfCards = pickle.load(infile) infile.close() pokerHand = random.sample(deckOfCards, 5) print(pokerHand) Analyze a Poker. Write a program using the file DeckOfCardsList.dat that randomly selects and displays five cards from the deck of cards and determines which of the following seven categories describes the hand: four-of-a-kind, full house (three cards of one rank, two cards of another rank), three-of-a-kind, two pairs, one pair, or ranks-all-different. (Hint: Determine the number of different ranks in the hand and analyze each of the four possible cases.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
