Num1=float
Num2=float
Ans=float
operator=int
print("These are the following operations available:\n, 1 for addition.\n 2 for subtraction.\n 3 for multiplication.\n 4 for division.")
operator = int(input("Enter the operator you wish to use"))
Num1 = float(input("Please enter your first number:"))
Num2 = float(input("Please enter your second number:"))
if operator ==1:
Ans == Num1 + Num2
else:
if operator ==2:
Ans == Num1 - Num2
else:
if operator ==3:
Ans == Num1 * Num2
else:
if operator ==4:
Ans == Num1 / Num2
print("Your answer is: %f.2", Ans)
TnVtMT1mbG9hdApOdW0yPWZsb2F0CkFucz1mbG9hdApvcGVyYXRvcj1pbnQKcHJpbnQoIlRoZXNlIGFyZSB0aGUgZm9sbG93aW5nIG9wZXJhdGlvbnMgYXZhaWxhYmxlOlxuLCAxIGZvciBhZGRpdGlvbi5cbiAyIGZvciBzdWJ0cmFjdGlvbi5cbiAzIGZvciBtdWx0aXBsaWNhdGlvbi5cbiA0IGZvciBkaXZpc2lvbi4iKQpvcGVyYXRvciA9IGludChpbnB1dCgiRW50ZXIgdGhlIG9wZXJhdG9yIHlvdSB3aXNoIHRvIHVzZSIpKQpOdW0xID0gZmxvYXQoaW5wdXQoIlBsZWFzZSBlbnRlciB5b3VyIGZpcnN0IG51bWJlcjoiKSkKTnVtMiA9IGZsb2F0KGlucHV0KCJQbGVhc2UgZW50ZXIgeW91ciBzZWNvbmQgbnVtYmVyOiIpKQppZiBvcGVyYXRvciA9PTE6CiAgICBBbnMgPT0gTnVtMSArIE51bTIKICAgIGVsc2U6CmlmIG9wZXJhdG9yID09MjoKICAgIEFucyA9PSBOdW0xIC0gTnVtMgogICAgZWxzZToKaWYgb3BlcmF0b3IgPT0zOgogICAgQW5zID09IE51bTEgKiBOdW0yCiAgICBlbHNlOgppZiBvcGVyYXRvciA9PTQ6CiAgICBBbnMgPT0gTnVtMSAvIE51bTIKcHJpbnQoIllvdXIgYW5zd2VyIGlzOiAlZi4yIiwgQW5zKQoKCgo=
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