title: Python-Multiple user inputs
body: <p>I am trying to take user input multiple times on python and then taking its sum.</p>
  
  <p>Taking user input multiple times means i need a new variable each time to store the user input.I need a program which can take infinite user inputs and ofcourse its impossible to assign a new variable to infinite user inputs and add them up.
  <strong>Is there any built-in function in python which can keep on adding the values itself?</strong></p>
  
  <p>Here is my code.It doesnt give me the sum because of sentinel(I dont understand why).
  Please help.</p>
  
  <pre><code>var = int(raw_input("Enter 1,2,3 or 4 for add,subtract,multiplication,division      respectively: "))
  if var == 1:
   print "You chose to add.Lets add!! :)"
  def main ():
   total = 0.0
   while True:
    number = int(raw_input('enter a number: '))
    if number == 0:
    total+=number
    break
    print 'the total is', total
  </code></pre>
  
  <p>main ()</p>