title: Working on a basic python calculator and can't get my menu to loop properly
body: <p>Thanks to this site I was able to get this far, being the python novice I am, however I'm kind of stuck.  I'm trying to loop 'selection', so after a user does some math, rather than just ending it will give them the option to do something else until they select 0 to quit.  I tried a bunch of other try and conditional statements but just end up getting answers and such stuck in an infinite loop.</p>
  
  <p>Also, I'm pretty here, but any help is appreciated, also I'm a python nub.  I'm writing this with python 2.7, if that matters. </p>
  
  <pre><code>def sum ( arg1, arg2):
   total = a + b
   return total;
  
  def subtract ( arg1 , arg2):
       total = a - b
       return total;
  
  def mult ( arg1, arg2):
       total = a * b
       return total;
  
  def division ( arg1, arg2):
       total = (a / b) 
       return total;
  
  
  
  options = ["1", "2", "3", "4", "5", "0"]
  
  print ("Please choose an option for mathing")
  print ("1 for addition")
  print ("2 for division")
  print ("3 for subtraction")
  print ("4 for multiplication")
  print ("5 ")
  print ("0 to exit")
  
  
  #this will keep prompting the user to provide an input that is listed in 'options'
  while True:
      selection = input("Please select choose an option to continue")
      if selection in options:
          break
  
      else:
          print("Please choose a valid option")
  
  #user input for mathing
  #input will be validated as follows
  a = None
  while a is None:
    try:
       a = int(input("please provide a number for A"))
    except ValueError:
       print "please use a valid integer"
       pass
  
  b = None
  while b is None:
    try:
       b = int(input("please provide a number for B"))
    except ValueError:
      print "please use a valid integer"
      pass
  
  
  #performing the operations
  
  if selection == '1':
      print "The sum is", str(sum(a, b))
  
  elif selection == '2':
      print "The quotient is", str(division(a, b))
  
  elif selection == '3':
      print "The difference is", str(subtract(a, b))
  
  elif selection == '4':
      print "The product is", str(mult(a, b))
  
  elif selection == '0':
      exit()
  </code></pre>