title: Greater than less than, python
body: <p>I am doing a ranking type thing, what happens is I compare the score to the current score and if the score is lower then the current then the player has got a high score, but when using this code here</p>
  
  <pre><code>        print "Score = " + str(score) + ", Compared to = " + str(array[x])
          if score &lt; array[x]:
                  #Do stuff here
  </code></pre>
  
  <p>But even if score is 4 and array[x] is 2 the if statement is still done?</p>
  
  <p>Am I doing something wrong?</p>
  
  <p>My understanding is that if score 4 and array[x] is 2 then 4 is greater than 2 which means it comes back False?</p>
  
  <hr>
  
  <p>Heres the full code</p>
  
  <pre><code>def getRank(array, score):
      rank = 0
      rankSet = False
      for x in range(0, len(array)):
          print "Score = " + str(score) + ", Compared to = " + str(array[x])
          if score &lt; array[x]:
              if not rankSet:
                  rank = x
                  print "Set rank to: " + str(rank)
                  rankSet = True
          elif score == array[x] or score &gt; array[x]:
              rank += 1
              print "Rank higher than " + str(x)
      print "Rank = " + str(rank)
      return rank
  </code></pre>
  
  <p>it prints this if score = 4 and the array is made up of [1, 2]</p>
  
  <pre><code>Score = 4, Compared to = 1
  Set rank to: 0
  Score = 4, Compared to = 2
  Rank = 0
  </code></pre>