I'm trying to create an interface with Python 3 on which to play a variety of card games. At the moment I've been making classes for cards, decks, players and "tables" and I'm having a small problem with the latter.
When writing my .deal() method to deal cards to the players at the table, I loop through players, draw the end card in the list of cards contained in the deck, removed it from the deck and assign it to the hand of the player in the loop. Seems simple enough? However, what actually happens is that all of the cards dealt go to all of the players, and I just can't see why? Could anyone help me? I'll put my code below.
for player in self.players:
card = self.deck.cards[-1]
self.deck.cards.remove(card)
player.hand.append(card)