title: MIT OCW Intro to CS practice test 1?
body: <p>The following code contains two semantic errors. Correct it so that it reads in integers until the user enters -1, and then prints the sum of the integers (8 points):</p>
  
  <pre><code>def getLines():
  
      inputs = []
      while True:
          line = raw_input('Enter a positive integer, -1 to quit: ')
          if line == -1:
              break
          inputs.append(line)
  
  total = 0
  for e in getLines():
  total += e
  print total
  </code></pre>
  
  <p>I'm guessing you need to replace <code>getLines()</code> in the <code>for-loop</code> with an actual list. The function must return the list <code>inputs</code>. </p>
  
  <p>But inside the function's <code>while loop</code>, <code>if line == -1:</code> never returns True. How come?</p>
  
  <p>Thanks</p>