How to use classes in python when dealing with poker hands?
<p>I'm taking a first course in python, and since my text book is quite shallow I am trying to get familiar with classes by hands on experience. </p>

<p>I am wanting to write a program that deals a number of texas hold'em poker hands (one hand to begin with), then deals five cards to the table, before it looks at all the possible hand permutations with 5 table cards and 2 hand cards. (One can combine the two cards of ones hand with three of the five cards of the table). Eventually i want to expand it to compare and evaluate the hands, and nominate a winner. But that will be for later. </p>

<p>What I am curious to find out is a good way to structure this problem with classes. </p>

<p>Would it be wise to make a Hand class that holds a deal-function  and contains the different hands dealt, and let deck be a global variable? </p>

<pre><code>#The hand-class is a class for the dealt poker-hands. 

import random

deck = [i for i in range (102, 115)]
deck += [i for i in range(202, 215)]
deck += [i for i in range(302, 315)]
deck += [i for i in range(402, 415)]
# I define a card by a prefix number - the suit - and the card value. Jack of     spades = 111 if spades corresponds to 1. 

class Hand:
    def __init__(self):
        return None
    def deal_hand(self):
        self.hand = []
        for i in range (0,2):
            card = random.choice(deck)
            self.hand.append(card)
            deck.remove(card) 

    #def score():
        #a function to determine the sore of the hand..
</code></pre>

<p>What I am asking is: What is the correct way to use classes for this purpose? Should I make another class to hold the five cards dealt to the poker table, and yet another class to hold the different permutations? </p>

<p>Or should both the hands, the hand's score, the table's dealt cards and the different permutations of the hand's cards to the table's all belong to the same class? </p>

<p>I am not asking anybody to write me any code, but if you had time to give me a quick hint on which direction I should be looking in, I would be very thankfull! 
Thanks!
Marius </p>
