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")
-
number
¶ Returns or sets the number (“2”-“10”, “J”, “Q”, “K”, “A”) of the Card
Returns: the card number as a string
-
suit
¶ Returns or sets the suit (hearts, clubs, diamonds, spades) of the Card
Returns: the card suit as a string
-
-
class
card.
Deck
¶ -
deal
(no_of_cards)¶ Deals (and removes) a number of cards from the deck.
Returns: list of Card objects
-
populate
()¶ Populates (resets) the deck of cards with all 52 cards in the order 2-10, J, Q, K, A, hearts, clubs, diamonds, spades.
-
shuffle
()¶ Shuffles the deck into a random order of playing cards.
-