A library for working with cards, decks, and hands in python
Project description
PyCardDeck
PyCardDeck is a python library for working with card decks, cards and hands in python.
Create Cards
from PyCardDeck import Card
ace_spades = Card(14, 'Ace', 'Spades')
print(ace_spades)
print(ace_spades.val)
print(ace_spades.name)
print(ace_spades.suit)
# Output: Ace of Spades
# 14
# Ace
# Spades
Create a Deck
from PyCardDeck import Deck
deck = Deck([]) # the deck is currently empty
print(deck) # output []
Create a Deck
with Cards
from PyCardDeck import Deck, Card
ace_spades = Card(14, 'Ace', 'Spades')
king_spades = Card(13, 'King', 'Spades')
deck = Deck([ace_spades, king_spades])
# Output: [{'value': 13, 'name': 'King', 'suit': 'Spades'}, {'value': 14, 'name': 'Ace', 'suit': 'Spades'}]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
CardDeckPy-2.1.0.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for CardDeckPy-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31af939951c536466b1dbc9715fa2f22817825eeaff302ac2de974d84df32df6 |
|
MD5 | 8df1b01662f8a6868019bab563c4d0e9 |
|
BLAKE2b-256 | 371efcb7309e885b4ed83e50a24e8ceab3961759da3d7e8fcae98e458220e6f4 |