| 48 | |
| 49 | |
| 50 | class Deck: |
| 51 | def __init__(self): |
| 52 | self.all_cards = [] |
| 53 | for suit in suits: |
| 54 | for rank in ranks: |
| 55 | # This assumes the Card class has already been defined! |
| 56 | self.all_cards.append(Card(suit, rank)) |
| 57 | |
| 58 | def shuffle(self): |
| 59 | random.shuffle(self.all_cards) |
| 60 | |
| 61 | def deal_one(self): |
| 62 | # we remove one card from the list of all_cards |
| 63 | return self.all_cards.pop() |
| 64 | |
| 65 | |
| 66 | def check_ace(card): |