1
0
Fork 0
mirror of synced 2024-05-20 20:42:27 +12:00

Add a pluck method

This commit is contained in:
Phxntxm 2017-04-16 22:49:35 -05:00
parent d485f64f25
commit 60f2b0e2e5

View file

@ -44,6 +44,10 @@ class Deck:
"""Adds the provided cards to the end of the deck"""
self.deck.extend(cards)
def pluck(self, card):
"""Pulls the provided card from the deck"""
return self.deck.pop(self.deck.index(card))
def shuffle(self):
"""Shuffles the deck in place"""
random.SystemRandom().shuffle(self.deck)