Modular Arithmetic Calculator
In Python, we can create a simple python calculator using simple if-else statements or even by using functions and classes, or also by using advanced math libraries. This project mainly deals with a user giving input where the computer will do fundamental arithmetic operations such as addition, subtraction, multiplication, and division. We can either create a simple calculator using the if-elif statements and an advanced calculator as well. The Python programming language and its vast libraries available which offer wide range of applications to use when working with numbers and evaluating mathematical expressions. This can be then inherited to create simple and effective program to solve most real-world problems. This project will guide you step by step that explains how to create a Modular Arithmetic Calculator program in Python. This calculator will only be able to perform basic arithmetic operations like addition, subtraction, multiplication and division. For the future enhancements we can even add some more intents which will give more power to our calculator to even use trigonometric functions. This can be very helpful to for the beginners to get hands on project with programming and can even for intermediate python users to refresh the basic concepts.
- Importing the module – Tkinter
- Create the main window (container)
- Add any number of widgets to the main window.
- Apply the event Trigger on the widgets
- Assigning the calculation methods +,-,*,/ .
Code Description & Execution
How to Execute?
Step 1 :
You need to open the jupyter notebook in the path directory on the anaconda prompt shell.
In my case
To perform the above step you already need to have knowledge of installing jupyter notebook and running anaconda shell, if you don’t know how to install or run jupyter notebook check our previous articles about it.
Step 2 :
Open .ipynb file from the folder
- Install required libraries using command pip install (library_name) for example
- Pip install tkinter.
Required libraries are written in code please refer.
Now you need to run by run command or by using shortcut key shift+enter
- This part is crucial you need to wait for each cell to execute properly.
Issues you may face
- While giving right path in the Anaconda prompt shell to open jupyter notebook in correct directory or opening the correct ipynp file.
All the required data has been provided over here. Please feel free to contact me for model weights and if you face any issues.
Yes, you now have more knowledge than yesterday, Keep Going.
Click Here To Download This Code And Associated File.