Question: Create a Class called Deck in Python: ( You dont have to create the CLASS for CARD just imagine, Class Card is created. The Deck

Create a Class called Deck in Python: (You dont have to create the CLASS for CARD just imagine, Class Card is created. The Deck class (15 marks) represents a deck of cards (stored in a list of Card fields) and uses the
Card class. A deck of cards may have up to 52 cards. The class must support the following
methods/operations:
__init__(self): Create a standard deck of cards (no jokers). The deck should contain cards
in ascending order (2C,3C,..., AS).
__len__(self),__repr__(self), and __str__(self)
shuffle(self): Shuffle the deck to mix up the cards.
draw(self): Select and return one card (the top card) from the deck. This card is removed
from the deck.

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 Databases Questions!