title: Python - formatting a file.write string with spaces
body: <p>I have a program and reads from a .txt file that I have created using another python code. I'm having trouble finishing this one. </p>
  
  <p>It needs to read the .txt and spit out the numbers in that file along with their sum. Here's what I've got so far:</p>
  
  <pre><code> def main():
      total = 0
      myfile = open('numbers.txt', 'r')
      for line in myfile:
          amount = float(line)
          total += amount
      print('End of file')
      print('Numbers in file add up to ', format(total, ',.1f'), end='')
      myfile.close()
  
  main()
  </code></pre>
  
  <p>I get the error msg:</p>
  
  <pre><code>ValueError: could not convert string to float: '11 13 11 7 7'
  </code></pre>