title: Splitting values that has strings and integers in python
body: <p>I am doing a small programming task for school and I need to know how to split a value in a list that contains strings and integers, in order to sort them numerically later using the lambda function. This is not working for me.</p>
  
  <pre><code>with open("task2class1.text","r") as file1:
     for line in file1:
         name, score = line.split()
         score = int(score)
         hightolow.append((name,score))
         hightolow.sort(key=lambda s: s[1])
         for name, score in reversed (hightolow):
  </code></pre>
  
  <p>The file "task2class1.text" looks like this:</p>
  
  <p>Scott | 10</p>
  
  <p>James | 8</p>
  
  <p>Alex | 7</p>
  
  <p>Ollie | 2</p>
  
  <p>Connor | 1</p>
  
  <p>Scott | 2</p>
  
  <p>Scott | 3</p>
  
  <p>Scott | 4</p>
  
  <p>Scott | 8</p>
  
  <p>Scott | 9</p>
  
  <p>Help would be much appreciated, thanks.</p>