Posts: 37
Threads: 15
Joined: Jun 2018
Jun-23-2018, 06:59 PM
(This post was last modified: Jun-23-2018, 08:11 PM by Panda.)
I'm making a simple calculator, but when you input 1 + 1, the program returns "11". I don't get any errors, but is there a way to change the string that you type, into an int that can be added in an equation?
Self-taught HTML, CSS, Python, and Java programmer
Posts: 37
Threads: 15
Joined: Jun 2018
Jun-23-2018, 07:19 PM
(This post was last modified: Jun-23-2018, 08:11 PM by Panda.)
(Jun-23-2018, 07:04 PM)gontajones Wrote: Does the user input the whole expression or just the numbers?
For the whole expression you can try this:
py-expression-eval
Just the numbers.
I solved it myself.
During the equation, i added int() around the strings.
Self-taught HTML, CSS, Python, and Java programmer