Skip to content

Latest commit

 

History

History
77 lines (63 loc) · 3.01 KB

File metadata and controls

77 lines (63 loc) · 3.01 KB

python-development-ks

This python-development-ks repository contains projects built as a part of internship training program using python3

Task 1: Simple Calculator

Main Goals:

  • Create a calculator that can perform basic arithmetic operations.
  • Implement functions for each operation.
  • Use a loop to allow multiple calculations.

Prerequisites:

  • Python 3.12.5

  • install pip packages using requirements.text using command 'pip install -r requirements.txt'

  • pip packages used : pyment and colorama

  • Note : how to generate automated docstring template ? 'pyment -w -o numpydoc <finename.py>'

How to run?

```python3 calculator.py

Output

    
    This Calculator program  allows you to perform operations like addition, subtraction, multiplication , division.
    You will be prompted to enter input numbers and choice of operation.
    
                                        Ready??
    ...............................................................................................................
     
press ENTER to continue :
Great! now you will be prompted two enter numbers ( operands ) on which you wish to perform calculations.
Enter a number (or 'done' to finish): 12
Enter a number (or 'done' to finish): 122.9
Enter a number (or 'done' to finish): 122.0
Enter a number (or 'done' to finish): 0.0
Enter a number (or 'done' to finish): done
 
     ......................................................
     Please enter your choice to perform below operations:
    .......................................................
     Press  1   for     ADDITION
     Press  2   for     SUBTRACTION
     Press  3   for     MULTIPLICATION
     Press  4   for     DIVISION
     Press  0   for     EXIT
     Press  r   for     RESET
     .......................................................
     
enter your choice  :1
Result of Addition :  256.9
 
     ......................................................
     Please enter your choice to perform below operations:
    .......................................................
     Press  1   for     ADDITION
     Press  2   for     SUBTRACTION
     Press  3   for     MULTIPLICATION
     Press  4   for     DIVISION
     Press  0   for     EXIT
     Press  r   for     RESET
     .......................................................
     
enter your choice  :4
Result of Division :  div by zero error
 
     ......................................................
     Please enter your choice to perform below operations:
    .......................................................
     Press  1   for     ADDITION
     Press  2   for     SUBTRACTION
     Press  3   for     MULTIPLICATION
     Press  4   for     DIVISION
     Press  0   for     EXIT
     Press  r   for     RESET
     .......................................................
     
enter your choice  :0
You chose to exit, goodbye!