title: What is syntax error of this?
body: <p>I had written a small console calculator in python:</p>
  
  <pre><code>def calculator(num1=0, num2=0):
      conta = input("Type operation(+,x,/ or -:)")
      if (conta == "+"):
          print("Result:" + repr(num1) + " + " + repr(num2) + " is " + str(num1 + num2))
      elif (conta == "-"):
          print("Result:" + repr(num1) + " - " + repr(num2) + " is " + str(num1 - num2))
      elif (conta == "x"):
          print("Result:" + repr(num1) + " x " + repr(num2) + " is " + str(num1 * num2))
      elif (conta == "/"):
          print("Result: " + repr(num1) + " + " + repr(num2) + " is " + str(num1 / num2))
      else:
          print("Result:" + repr(num1) + conta + repr(num2) + " is Are you Joking?")
  
  try:
      num1 = float(input("Type a number:"))
      num2 = float(input("Type a number:"))
      calculator(num1, num2)
  except:
      print("Error.")
      exit()
  </code></pre>
  
  <p>It works properly in IDLE Shell. I put:</p>
  
  <pre><code>500.65 + 300 = 700.65
  12 joke 12 = Are you Joking?
  </code></pre>
  
  <p>And then...When I load it from .PY file, It asks a number. I put it. Asks another. Put it. Asks for operation. I put one. The window closes.</p>
  
  <p>Now I try to run it on Python console. Returns:</p>
  
  <blockquote>
    <p>SyntaxError in line 1 => Invalid Syntax.</p>
  </blockquote>
  
  <p>So, what's wrong? What can I do?</p>