import random class Card: def __init__(self, suit, rank): self.suit = suit self.rank = rank class Deck: def __init__(self): suits = ['Hearts', 'Diamonds', 'Clubs', 'Spades'] ranks = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A'] self.cards = [Card(suit, rank) for suit in suits for rank in ranks] random.shuffle(self.cards) def deal(self, num_cards): return [self.cards.pop() for _ in range(num_cards)] class PokerGame: def __init__(self): self.deck = Deck() self.players = [] self.community_cards = [] def add_player(self, player_name): self.players.append({'name': player_name, 'hand': []}) def deal_initial_cards(self): for _ in range(2): for player in self.players: player['hand'].extend(self.deck.deal(1)) def display_players(self): for player in self.players: print(f"{player['name']}'s hand: {', '.join([card.rank + ' of ' + card.suit for card in player['hand']])}") def display_community_cards(self): print(f"Community cards: {', '.join([card.rank + ' of ' + card.suit for card in self.community_cards])}") def play(self): self.deal_initial_cards() self.display_players() # Add logic for betting rounds, community cards, and determining the winner # For simplicity, this example does not include all the rules of poker. if __name__ == "__main__": poker_game = PokerGame() num_players = int(input("Enter the number of players: ")) for i in range(num_players): player_name = input(f"Enter the name for player {i + 1}: ") poker_game.add_player(player_name) poker_game.play()