title: Write a program that prints out the sum of the numbers in the file
body: <p>I have written the following program that reads numbers from a file.  I can assume that each line contains only a single floating number.</p>
  
  <pre><code>filename = input("Please enter your file name: ")
  sum_number = 0
  
  openthefile = open(filename, "r")
  for i in openthefile:
      sum_number = sum_number + float(i)
      print("The sum of your numbers is", sum_number)
  </code></pre>
  
  <p>I gave it the file named <code>number.txt</code> which contains:</p>
  
  <pre><code>8.0
  -2.5
  100.0
  6.5
  </code></pre>
  
  <p>and my program printed out:</p>
  
  <pre><code>The sum of your numbers is 8.0
  The sum of your numbers is 5.5
  The sum of your numbers is 105.5
  The sum of your numbers is 112.0
  </code></pre>
  
  <p>But, I just needed the last line to be printed out.</p>