title: Used {input = map(float, raw_input().split()).} How to accept if user input 1 float number?
body: <p>I'm asking user to input their score and credit in one line, separated by a space, I've made it into a loop, so that when user enter -1, the program prints 'Program ends.' </p>
  
  <pre><code>input = map(float, raw_input().split())
  gpa, credit = input
  
  print 'Current GPA: %.2f' % gpa
  while True:
      if input[0] != -1:
         input = map(float, raw_input().split())
         gpa = ((gpa * credit) + (input[0] * input[1])) / (credit + input[1])
         print 'Current GPA: %.2f' % gpa
      if input [0] == -1:
         print 'Program ends.'
         break
  </code></pre>
  
  <hr>
  
  <pre><code>sample output: 
  3.7 3
  Current GPA: 3.70
  3.3 2 
  Current GPA: 3.54
  -1
  Program ends.
  </code></pre>
  
  <p>but I've got an error like this:</p>
  
  <pre><code>Output: 
  3.7 3
  Current GPA: 3.70
  3.3 2 
  Current GPA: 3.50
  -1
  
  Traceback (most recent call last):
    File "/Users/tiffany/PycharmProjects/Labs/p3.py", line 8, in &lt;module&gt;
      gpa = ((gpa * credit) + (input[0] * input[1])) / (credit + input[1])
  IndexError: list index out of range
  
  Process finished with exit code 1
  </code></pre>
  
  <p>Could someone please tell me how to solve this? Thanks!</p>