# Deck of cards


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

``` python
from nbdev.showdoc import *
from nbdev_project.card import Card
from fastcore.test import *
```

------------------------------------------------------------------------

<a
href="https://github.com/majarall/nbdev-project/blob/main/nbdev_project/deck.py#L12"
target="_blank" style="float:right; font-size:smaller">source</a>

### Deck

>  Deck ()

*Initialize self. See help(type(self)) for accurate signature.*

Create a deck of card and check that there is 52 cards there.

``` python
deck = Deck()
test_eq(len(deck), 52)
```

``` python
Card??
```

    Init signature: Card(suit: int, rank: int)
    Source:        
    class Card:
        """A playing card, created by passing in rank from ranks and suit from suits"""
        def __init__(self, 
                     suit:int,     # An index into suits 
                     rank:int):    # An index into ranks
            self.suit = suit
            self.rank = rank 
        def __str__(self):
            return f"{ranks[self.rank]}{suits[self.suit]}"
        
        def __eq__(self,a):
            if isinstance(a,Card):
                return (self.suit,self.rank) == (a.suit, a.rank)
            else:
                return False

        __repr__ = __str__           # use the same formating as jupyter
    File:           ~/git/nbdev-project/nbdev_project/card.py
    Type:           type
    Subclasses:     

------------------------------------------------------------------------

<a
href="https://github.com/majarall/nbdev-project/blob/main/nbdev_project/deck.py#L30"
target="_blank" style="float:right; font-size:smaller">source</a>

### Deck.pop

>  Deck.pop ()

``` python
test_eq(deck.pop(), Card(3,13))
```
