title: Python: Searching from File, getting largest number
body: <p>So the program must find the player with the highest score in each level.
  I have a text file called <code>playerScores.txt</code> which has the name, the score, and the level every line. Example in format <code>Player:Level:Score</code>:</p>
  
  <pre><code>Starplayer,1,19
  </code></pre>
  
  <p>The program must find the highest scorer for each level, so for level 1 it must find the highest number. This is what I got so far:</p>
  
  <pre><code>playerData = open("playerScores.txt", "r") #opening file with data
  level = input("Game Level?") # asking for which level
  for line in playerData: 
      if(line.split(",")[1] == level):
              print(level)
              print(line.split(",")[0])
              print(line.split(",")[2])
  </code></pre>
  
  <p>This finds the number after the second comma for each level but it finds all the numbers and not just the highest number.</p>