title: Python: a type error
body: <p>So here is my situation. Ive been trying to make a advanced calculator in python 3.4, one where you can just type something like this. '1 + 1', and it would then give you the answer of '2'. Now i will explain how my calculator is supposed to work. So you start by entering a maths equation, then it counts the words you entered based on the spaces. It does this so it knows how long some future loops need to be. Then it splits up everything that you entered. It splits it up into str's and int's but its all still in the same variable and it's all still in order. The thing i'm having trouble with is when it is meant to actually do the calculations.</p>
  
  <p>here is all of my code-</p>
  
  <pre><code>    # This is the part were they enter the maths equation
      print("-------------------------")
      print("Enter the maths equation")
      user_input = input("Equation: ")
      # This is were it counts all of the words
      data_count = user_input.split(" ")
      count = data_count.__len__()
      # Here is were is splits it into str's and int's
      n1 = 0
      data = []
      if n1 &lt;= count:
          for x in user_input.split():
              try:
                  data.append(int(x))
              except ValueError:
                  data.append(x)
              n1 += 1
      # And this is were it actually calculates everything
      number1 = 0
      number2 = 0
      n1 = 0
      x = 0
      answer = 0
      while n1 &lt;= count:
          #The code below checks if it is a number
          if data[n1] &lt; 0 or data[n1] &gt; 0:
              if x == 0:
                  number1 = data[n1]
              elif x == 1:
                  number2 = data[n1]
          elif data[n1] is "+":
              if x == 0:
                  answer += number1
              elif x == 1:
                  answer += number2
          n1 += 1
          x += 1
          if x &gt; 1:
              x = 0
      print("Answer =", answer)
  </code></pre>
  
  <p>but during the calculation it messes up and gives me and error</p>
  
  <p>error-</p>
  
  <pre><code>    if data[n1] &lt; 0 or data[n1] &gt; 0:
      TypeError: unorderable types: str() &lt; int()
  </code></pre>
  
  <p>can anyone see what i am doing wrong here?
  Thanks</p>