This simple calculator program allows users to perform basic arithmetic operations such as addition, subtraction, multiplication, and division.
- Run the program.
- Enter the first number when prompted.
- Choose an operation from the available options:
+(addition),-(subtraction),*(multiplication),/(division). - Enter the second number.
- The result of the calculation will be displayed.
- You'll be prompted to continue with the result obtained or start a new calculation.
add(n1, n2): Function to perform addition.subtract(n1, n2): Function to perform subtraction.multiply(n1, n2): Function to perform multiplication.divide(n1, n2): Function to perform division.operations: Dictionary containing mapping of operation symbols to their respective functions.calculator(): Function to handle the main calculator functionality.
- Python 3.x
artlibrary (install viapip install art)
- Make sure you have Python installed on your system.
- Download
art.pyfrom github - Run the script.
- Follow the on-screen instructions to perform calculations.