Python Calculator
How to use
Check your python version with python --version
.
If the version is 3.x
then simply do
python cli.py multiply 2 7 3
If the version is 2.7.x
then download Python 3 and use like this.
python3 cli.py multiply 2 7 3
The result of running the above commands should be
------
42
------
Note- You can enter as many numbers as you want. Try running python3 cli.py average 2 7 3 11 89
.
How to add new operations
- Define a new method in
Calculator.py
. - Add the condition for calling new method in the
calculate
function ofcli.py
.