- 2

How to complete the "simple calculator" in strings and variables in python 3?

12th Nov 2020, 7:30 AM
Should I Care?
Should I Care? - avatar
3 odpowiedzi
0
You just need to add the two inputs. input() returns a string that you have to convert with int()
12th Nov 2020, 9:05 AM
Benjamin Jürgens
Benjamin Jürgens - avatar
0
1. You will need to setup your inputs to show num1, num2 & your operator, (+,÷,/,×,**,%) etc 2. Turn your num inputs into integers 3. Design your program to recognise the operator, then operate upon the 2 integers to get your result. 4. A lot of people use if, elif, else arguments to achieve this but there are other methods including functions and dictionaries. Start simple and build from your successes, IE: Try to create 1 operation only, (5+6) = ? If you can do one, you can do them all. Good luck
12th Nov 2020, 7:38 AM
Rik Wittkopp
Rik Wittkopp - avatar
0
Thanks
12th Nov 2020, 7:39 AM
Should I Care?
Should I Care? - avatar