title: Python split users input
body: <pre><code># Enter Function
  def enter(self,newval):
      self.value = newval
  
  # Add Function
  def add(self,newval):
      self.value += newval
  
  # Subtract Function
  def subtract(self,newval):
      self.value -= newval
  
  class Accumulator:
  def __init__(self,newval = 0):
      self.value = newval
  
      acc = Accumulator()
  
      if operator == 'e' or operator == 'E':
          acc.enter(newval)
      elif operator == 'a' or operator == 'A':
          acc.add(newval)
      elif operator == 's' or operator == 'S':
          acc.subtract(newval)
  
  
  calculator = input("Enter a number, followed by a space, then a valid operator: ").split
  </code></pre>
  
  <p>I am trying to take the users input to create a calculator like idea. I understand how I can take 1 value of input but I don't know how to take 2 values of input "or split" and set them equal to my problem above If the user enters "5 a" it will set 5 as the (newval) value and call to the add function. If the user enters "5 s" it will set 5 as the (newval) value and call to the subtract function and eventually print out the accumulating total.</p>