title: typeerror slice indices must be integers or none or have an __index__ method
body: <p>I tired to run this program, but it would give me the above error on line 15 
  the program supposed to evaluate a preorder arithmetic expressions where it takes a single expression from stdin and output the result </p>
  
  <pre><code>return (preOrder( lst [ 1 : ( (len(lst)+1)/2) ] )  +   preOrder( lst [ (len(lst) + 1)/2 : ] ))
  </code></pre>
  
  <p>here is my program </p>
  
  <pre><code>def preOrder(lst) :
          if len(lst) == 3 :
              if lst[0] == '+' :
                  return lst[1] + lst[2]
              elif lst[0] == '-' :
                  return lst[1] - lst[2]
              elif lst[0] == '*' :
                  return lst[1] * lst[2]
              elif lst[0] == '/' :
                  return lst[1] / lst[2]
              elif lst[0] == '%' :
                  return lst[1] % lst[2]
          else :
              if lst[0] == '+' :
                  return (preOrder( lst [ 1 : ( (len(lst)+1)/2) ] )  +   preOrder( lst [ (len(lst) + 1)/2 : ] ))
              elif lst[0] == '-' :
                  return preOrder( lst [ 1 : ( (len(lst)+1)/2) ] )  -   preOrder( lst [ (len(lst) + 1)/2 : ] )
              elif lst[0] == '*' :
                  return preOrder( lst [ 1 : ( (len(lst)+1)/2) ] )  *   preOrder( lst [ (len(lst) + 1)/2 : ] )
              elif lst[0] == '/' :
                  return preOrder( lst [ 1 : ( (len(lst)+1)/2) ] )  /   preOrder( lst [ (len(lst) + 1)/2 : ] )
              elif lst[0] == '%' :
                  return preOrder( lst [ 1 : ( (len(lst)+1)/2) ] )  %   preOrder( lst [ (len(lst) + 1)/2 : ] )
      pre = ['+', '+', 6, 3, '-', 8, 4]
      print ("preorder:")
      print (pre)
      print (preOrder(pre))
  </code></pre>