나머지 메서드는 Deck에서 상속받은 것으로 pop_card와 add_card를 사용해 카드를 다룰 수 있다.
>>> deck = Deck()
>>> card = deck.pop_card()
>>> hand.add_card(card)
>>> print(hand)
King of Spades
다음 단계는 당연하게도 move_cards 메서드에 이 코드를 캡슐화하는 것이다.
#class Deck: 정의
def move_cards(self, hand, num):
for i in range(num):
hand.add_card(self.pop_card())