Classes: Attributes and Methods

class deck_of_cards.Card(suit_rank_tup)

Attributes

self.suit = suit_rank_tup[0]
self.rank = suit_rank_tup[1]
self.value = self.rank
self.name = self._translate_card()
self.image_path = ""

class deck_of_cards.DeckOfCards()

Attributes

self.deck = [Card(tup) for tup in self.SUITS_RANKS]

Methods

add_deck()
:return: deck object

Adds another deck of cards to the existing deck

add_jokers()
:return: deck object

Adds jokers to the deck

give_first_card()
:return: card object

Gives the first card in the deck

give_last_card()
:return: card object

Gives the last card in the deck

give_random_card()
:return: card object

Gives a random card from the deck

order_deck()
:return: deck object

Sorts the cards in the deck by value and suit

print_deck()
:return: print statement

Prints the name of the cards in the deck

reset_deck()
:return: deck object

Resets the deck object

shuffle_deck()
:return: deck object

Shuffles the cards in the deck

take_card(card)
:param card: card object
:return: deck object

Adds a card to the deck