+ 1
Help with Calculator
Can any one assist I keep gettin and error when I try to run the task num1 = float(input("enter first number: ")) op = input("enter operator: ") num2 = float(input("enter second number: ")) if op == "+": print(num1 + num2) elif op == "-": print(num1 - num2) elif op == "/": print(num1 / num2) elif op == "*": print(num1 * num2) else: print("invalid operator")
7 Respostas
+ 6
hi jesse, your code is running perfectly. I belive the problem is to do the input correctly in Code Playground. You have to do it like this: (when input window comes up) Place each input in a separate line then klick submit.
2
+
3
(press submit)
this will show 5
+ 2
Jesse, do you have the code in the playground? If yes - just include the link for me. I have to see what error occures.
+ 2
jesse, here is your code in playground: try it.
https://code.sololearn.com/cTsOZYyrtjnb/?ref=app
+ 1
thanks i really appreciate it
0
I gave it a shot but im still getting the same error
0
File "..\Playground\", line 1
num1 = float(input("enter first number:
^
SyntaxError: EOL while scanning string literal