title: Comparing two cards in list
body: <p>I'm trying to write Russian Schnapsen (Thousand Schnapsen) but I'm stuck at comparing two cards on the table (table is list with only two cards). Here's not entire code, because entire is not necessery and I would have to translate all my variables from native language to english. </p>
  
  <pre><code>import random
  
  class Cards:    
      def __init__(self,rank,suit):
          self.rank = rank
          self.suit = suit
  
      def show(self):
          if self.rank == 10:
              rank = 'J'
          elif self.rank == 11:
              rank = 'Q'
          elif self.rank == 12:
              rank = 'K'
          elif self.rank == 13:
              rank = '10'
          elif self.rank == 14:
              rank = 'A'
          else:
              rank = self.rank
          print(rank,self.suit)
  
  class Deck:
      def __init__(self):
          self.cards = []
          self.build()
          self.shuffle()
  
      def build(self):
  
          for suit in ['Spades', 'Clubs', 'Diamonds', 'Hearts']:
              for rank in range(9,15):
                  self.cards.append(Cards(rank, suit))
  
      def shuffle(self):
          random.shuffle(self.cards)
  </code></pre>
  
  <p>And there is class <code>Game</code> with not working function check (list table is filled with two cards earlier)</p>
  
  <pre><code>class Game:
      def __init__(self):
          self.table = []    
  
      def check(self):
          x = self.table[0]
          for card in self.table:
              if card &gt; x:
                  # (rest of the code...)
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code>TypeError: '&gt;' not supported between instances of 'Cards' and 'Cards'
  </code></pre>
  
  <p>My main and only question is how could I compare two cards in list (or maybe there is better solution than doing it in list) by their rank. </p>