Calculator - need help | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Calculator - need help

take a look on this code: one = input("input number") two = input("input number") operation = one + two If you run this code it will show you error message line 3 , it tells that you try to "str" + "str" write how to fix it or what's problem

31st May 2017, 3:43 PM
Barosz Sójka
Barosz Sójka - avatar
3 Antworten
+ 4
You won't run tkinter module on Sololearn. Try running your code in a proper IDE and it should work, provided that tkinter module gets imported properly. Also, you have to name the addition and division buttons differently :)
31st May 2017, 4:39 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
input by default is a string. your trying to add 2 strings.. try this for your inputs one=int(input("input number")) This will take the input as an integer
31st May 2017, 4:02 PM
LordHill
LordHill - avatar
0
I use python and i don't want to change it and thanks Justin Hill that helped, it doesn't shows error message but something is still wrong. Just run this code(but do that what Justin Hill said) and see.
31st May 2017, 4:33 PM
Barosz Sójka
Barosz Sójka - avatar