title: Formatting a txt file on python
body: <p>I would like to know how to display the .txt file I am opening alpahbetically, also how to show in order of scores high to low etc and how to work out an average</p>
  
  <pre><code>score= str(score)
  class_name = clas + ".txt"
  file = open(class_name , "a")
  file.write(name)
  file.write(" : ")
  file.write (score)
  file.write("\n")
  file.close()
  ##########################
  read = input("Would you like to see your classes previous scores? ")
  if read == "yes".lower():
      file = open(class_name,"r")
      lines = file.read()
      file.close()
      print (lines)
  else:
      print("The program will now close")
  </code></pre>
  
  <p>The file save the data inputted in the format<br>
  Name : Score</p>