def test_shuffle_deck(self):
     deck = Deck()
     initial_deck = deck.__str__()
     deck.shuffle()
     final_deck = deck.__str__()
     self.assertNotEqual(initial_deck, final_deck)
Beispiel #2
0
d.add_to_bottom(c)
print(d)
print("\n")
#Deal method, remove the top card
d = Deck()
d.deal()
print(d)
print("\n")
#Count method
print(d.count())
print()
print("\n")
#is_empty method, checks if the deck is empty and returns a bool
d = Deck()
d.is_empty()
print(d.is_empty())
print("\n")
#__str__ method, testing
d = Deck()
d.__str__()
print(d.__str__())
print("\n")
#Shuffle method
d.shuffle()
print(d)
print("\n")
#__init__ method
d = Deck()
d.__init__()
print(d.__init__())
Beispiel #3
0
 def __str__(self):
     s = self.name + ' hand:\n'
     s += Deck.__str__(self)
     return s