title: Is there a way to sort objects created through classes that is made up of both strings and integers in Python?
body: <p>I have an assignment to create a deck of cards through the use of a class with methods that deal, shuffle, fan, order and checks if the deck is in order but I am having trouble creating the last one. The deck must be ordered by their values in each suit, and the suits ordered as Clubs, Diamonds, Hearts, and then Spades. My code up to this point is found below:</p>
  
  <pre><code>import random
  
  class Card():
  
      def __init__(self, value, suit):
          self.value = value
          self.suit = suit
  
  
      def show_card(self):
          print(str(self.value)+ " of " + str(self.suit))
  
  
  class Deck():
  
      deck_of_cards = []
      cards_in_play = [] 
      draw_card = None
  
      def __init__(self):
          self.make_deck()      
  
  
      def make_deck(self):
          for suit in ['Clubs', 'Diamonds', 'Hearts', 'Spades']:
              for value in [2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen', 'King', 'Ace']:
                  self.deck_of_cards.append(Card(value,suit))
                  self.cards_in_play.append(Card(value, suit))
  
      def shuffle(self):
          self.shuffled_deck = random.shuffle(self.cards_in_play)
  
  
      def fan(self):
          for card in self.cards_in_play:
              card.show_card()
  
      def deal(self):
          draw_card=self.cards_in_play.pop()
          draw_card.show_card()
  
      def order(self):
          for suit in ['Club', 'Diamonds', 'Hearts', 'Spades']:
              for value in [2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen', 'King', 'Ace']:
                  self.deck_of_cards.append(Card(value, suit))
                  self.cards_in_play.append(Card(value, suit))
  </code></pre>