title: How do I sort data highest to lowest in Python from a text file?
body: <p>I have tried multiple methods in doing this but none of them seem to work
  The answer comes up alphabetically instead</p>
  
  <pre><code>f=open("class2.txt", "r")
  scores=myfile.readlines()
  print(sorted(scores))
  f.close()
  
  ['Anne,   3\n', 'Dave,   10', 'Jack,   4\n', 'Lucy,   8\n']
  </code></pre>
  
  <p>Also is there any way to get rid of the "/n" when it goes to the shell?</p>