My calculator will only perform addition | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

My calculator will only perform addition

hi everyone, I was wondering if someone could let me know where my code needs changing as the calculator I have wrote will only perform addition. thanks. https://code.sololearn.com/c6Q4F0sxXVEB/?ref=app

9th Apr 2018, 11:48 AM
Jambon jovi
Jambon jovi - avatar
2 Respuestas
+ 3
Because answer variable in each if else statement does addition only that's why you get that result. replace plus operator with relevant ones everywhere. str(num1 + num2) -> str(num1 * num2) # for multiplication and so on..
9th Apr 2018, 12:03 PM
Lord Krishna
Lord Krishna - avatar
+ 1
ahhh rookie error 😁 thanks for the help.
9th Apr 2018, 12:27 PM
Jambon jovi
Jambon jovi - avatar