title: Calculating the average by inputing values in a file, code produces wrong output
body: <p>'''This simple program will calculate the average using files'''</p>
  
  <pre><code>num = 3
  try:     #set an exception in case of a file Error
  
      while num &gt;=0:  '''read in values and place them in a file'''
          value = int(input("Enter values: "))
          my_file = open('my_data.txt', 'w+')
          my_file.write(str(value))
          numbers = my_file.readlines()
          num -=1
      my_file.close()
  
  except IOError:
      print('FILE FAILURE')
  
  '''iterate to find the sum of the values in a file'''
  total = 0
      for ln in numbers: 
          total += int(ln)
  
  '''Calculate the average'''
  avg = total/len(numbers)
      print("The average is %d"%(avg))#FIXME: does not calculate average
  </code></pre>