You can clone with HTTPS or SSH.
import random """class Card(object): rank = "Ace" suit = "Hearts" def __str__(self): return "%s of %s" % (self.rank, self.suit) ace_of_hearts = Card() print ace_of_hearts""" class Card(object): ''' Implementation of a card class ''' ranks = [None, 'Ace', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King'] suits = ["Hearts", "Clubs", "Diamonds", "Spades"] def __init__(self, rank=2, suit=0): self.rank = rank self.suit = suit def __str__(self): return "%s of %s" % (self.ranks[self.rank], self.suits[self.suit]) def __gt__(self, other): if self.rank > other.rank: return True else: return False def __lt__(self, other): if self.rank < other.rank: return True else: return False def __eq__(self, other): if self.rank == other.rank: return True else: return False class Deck(object): '''Implementation of a deck of cards. ''' def __init__(self): self.cards = [] for s in range(4): for r in range(1, 14): card = Card(r, s) self.cards.append(card) def __str__(self): res = [] for card in self.cards: res.append(str(card)) return '\n'.join(res) '''prints what's in your hand, mostly for debugging''' def deal(self): return self.cards.pop(0) def add_card(self, card): self.cards.append(card) def shuffle(self): random.shuffle(self.cards) class Hand(Deck): pass def __init__(self): self.cards = [] if __name__ == '__main__': d = Deck() d.shuffle() print d