title: Can't read numbers from a text file in python
body: <p>I have to read a list of 12 grades from a text file. Each grade is on a new line in the text file. I have to find the lowest grade and drop it(in the text file as well), then find the average score of the grades. I am having trouble making the text values into integer values so I can find the average. I also can't figure out how to find the lowest grade and drop it.
  Here is my code:</p>
  
  <pre><code>try:
      homeworkFile = open('homework.txt', 'r')
  except:
      print("Error: invalid file")
  else:
      lines = homeworkFile.readlines()
  homeworkFile.close()
  
  homeworkFile = open('homework.txt', 'w')
  
  for line in lines:
  </code></pre>
  
  <p>Thanks for any help you can give!</p>