Code docs

class card.Card(suit, number)

The Card class represents a single playing card and is initialised by passing a suit and number.

A card is initialised using:

ace_of_spades = Card("spades", "A")

Returns or sets the number (“2”-“10”, “J”, “Q”, “K”, “A”) of the Card

Returns:the card number as a string

Returns or sets the suit (hearts, clubs, diamonds, spades) of the Card

Returns:the card suit as a string
class card.Deck

Deals (and removes) a number of cards from the deck.

Returns:list of Card objects

Populates (resets) the deck of cards with all 52 cards in the order 2-10, J, Q, K, A, hearts, clubs, diamonds, spades.


Shuffles the deck into a random order of playing cards.