title: How to take any number of inputs in python without defining any limit?
body: <p>Now, the thing is that I am supposed to take an unknown amount of input from the user like on one run he can enter 10 terms on another run he can enter 40. And I cannot ask user initially to enter the value of n so that I can run a range loop and start storing the input in list. If somehow I can do this then for that I have created the loop but that is not the case. So, the question is how to define the endpoint for user? or how to pass unknown number of arguments to the function?</p>
  
  <pre><code>def fibi(n):
      while n&lt;0 or n&gt;=50:
          print "Enter value of n greater than 0 but less than 50"
          n = int(raw_input())
      if n==0:
          return n
      else:
          a, b = 0, 1
          for i in range(n):
              a, b = b, a + b
      return a
  </code></pre>
  
  <h1>main calling function starts</h1>
  
  <pre><code>n =[]
  ????
  //This loop is for calling fibi function and printing its output on each diff line
  for i in n:
      print (fibi(n[i]))
  </code></pre>
  
  <h1>Sample Input:each entry should be on a new line</h1>
  
  <pre><code>1
  2
  3
  4
  5
  .
  .
  .
  n
  </code></pre>
  
  <h1>Sample Output</h1>
  
  <pre><code>1
  1
  2
  3
  5
  </code></pre>