+ 2
why my program is not running in playground???
print("welcome to my calculator!") x=str(input("would you like to addition(a),sabtraction(s),maltipication(m) or devide(d)")) if x=="a": number1 = int(input("pls enter the number1")) number2 = int(input("pls enter the number2")) print(number1+number2) elif x=="s": number1 = int(input("pls enter the number1")) number2 = int(input("pls enter the number2")) print(number1-number2) else: print("it's a simple calculator")
7 Answers
+ 3
One closing bracket is missing in each of these:
int(input("pls enter the number_")
+ 6
@SoloLearner: all int() closing brackets are missing ^^
+ 5
Many possibility:
+ because of the missing of closing parenthesis of all your int() call
+ because of the last unexpected 'p' char
+ because of the lack of the rest of the code
+ because you try to run a programm requiring interactive in/output from user (and you must enter all required input at once just before begin runing of the script -- after clicking on the "run" button but before script was executed)
+ 3
Check my answer closely ^^
+ 3
And read the returned error message: you miss a space to correctly indent your code ^^
0
after closed the brackets calculator not working properly..
- 1
instead of writing such long programs, try this code:
print(eval(input()))
in this program you do not need to enter the type of operation.
try something like this: 4*8%2+55/12-4