fork download
  1. Num1=float
  2. Num2=float
  3. Ans=float
  4. operator=int
  5. print("These are the following operations available:\n, 1 for addition.\n 2 for subtraction.\n 3 for multiplication.\n 4 for division.")
  6. operator = int(input("Enter the operator you wish to use"))
  7. Num1 = float(input("Please enter your first number:"))
  8. Num2 = float(input("Please enter your second number:"))
  9. if operator ==1:
  10. Ans == Num1 + Num2
  11. else:
  12. if operator ==2:
  13. Ans == Num1 - Num2
  14. else:
  15. if operator ==3:
  16. Ans == Num1 * Num2
  17. else:
  18. if operator ==4:
  19. Ans == Num1 / Num2
  20. print("Your answer is: %f.2", Ans)
  21.  
  22.  
  23.  
  24.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/py_compile.py", line 117, in compile
    raise py_exc
py_compile.PyCompileError:   File "prog.py", line 11
    else:
       ^
SyntaxError: invalid syntax

stdout
Standard output is empty