Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Extensible Calculator - code sample / take home test from long ago.

Notifications You must be signed in to change notification settings

mdylanbell/extensiblecalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Extensible Calculator

Intro

extensiblecalculator is a simple python class that allows you to perform calculations on integers. It is written to be extensible so that you can specify new operators besides the basics (*, /, +, -) provided here.

Result is returned as an int.

This code was written as an exercise and might not serve practical purpose.

Extending

To extend this module, you can create subclasses and define your own operators. See MoreFunctionaCalculator.py for subclassing example.

Code example:

from Calculator import Calculator

c = Calculator()

# Simple addition
result = c.calculate('3 + 5')

result == 8

About

Extensible Calculator - code sample / take home test from long ago.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages