/python-terminal-calculator

Simple terminal calculator for python beginners

Primary LanguagePython

Terminal Calculator 🔢🧮

Simple terminal calculator for Python beginners

Instructions

The objective is to provide an accurate result based on the equation the user inputted.

 _____________________
|  _________________  |
| | Pythonista   0. | |  .----------------.  .----------------.  .----------------.  .----------------. 
| |_________________| | | .--------------. || .--------------. || .--------------. || .--------------. |
|  ___ ___ ___   ___  | | |     ______   | || |      __      | || |   _____      | || |     ______   | |
| | 7 | 8 | 9 | | + | | | |   .' ___  |  | || |     /  \     | || |  |_   _|     | || |   .' ___  |  | |
| |___|___|___| |___| | | |  / .'   \_|  | || |    / /\ \    | || |    | |       | || |  / .'   \_|  | |
| | 4 | 5 | 6 | | - | | | |  | |         | || |   / ____ \   | || |    | |   _   | || |  | |         | |
| |___|___|___| |___| | | |  \ `.___.'\  | || | _/ /    \ \_ | || |   _| |__/ |  | || |  \ `.___.'\  | |
| | 1 | 2 | 3 | | x | | | |   `._____.'  | || ||____|  |____|| || |  |________|  | || |   `._____.'  | |
| |___|___|___| |___| | | |              | || |              | || |              | || |              | |
| | . | 0 | = | | / | | | '--------------' || '--------------' || '--------------' || '--------------' |
| |___|___|___| |___| |  '----------------'  '----------------'  '----------------'  '----------------' 
|_____________________|

What's the first number?: 

The computer will ask the user for the numbers and operation to be used, and then show the result after. It will also ask the user if they want to continue calculating using the result or start a new calculation.

What's the first number?: 5
+

-

*

/

Pick an operation from the line above: *
What's the next number?: 46
5.0 * 46.0 = 230.0
Type 'y' to continue calculating with 230.0, or type 'n' to start a new calculation:
Type 'y' to continue calculating with 230.0, or type 'n' to start a new calculation: y
+

-

*

/

Pick an operation from the line above: -
What's the next number?: 60 
230.0 - 60.0 = 170.0