+ 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")

29th Oct 2017, 7:01 AM
Zubayer Alam
Zubayer Alam - avatar
7 Answers
+ 3
One closing bracket is missing in each of these: int(input("pls enter the number_")
29th Oct 2017, 7:09 AM
Lakshay
Lakshay - avatar
+ 6
@SoloLearner: all int() closing brackets are missing ^^
29th Oct 2017, 7:14 AM
visph
visph - avatar
+ 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)
29th Oct 2017, 7:12 AM
visph
visph - avatar
+ 3
Check my answer closely ^^
29th Oct 2017, 7:30 AM
visph
visph - avatar
+ 3
And read the returned error message: you miss a space to correctly indent your code ^^
29th Oct 2017, 7:31 AM
visph
visph - avatar
0
after closed the brackets calculator not working properly..
29th Oct 2017, 7:26 AM
Zubayer Alam
Zubayer Alam - avatar
- 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
15th Dec 2017, 4:51 PM
Vishwatma Bhat