Calculator
# Calculator
class Calculator(skipError, useEval, showEquation)
- Attributes
- Methods
Represents a Calculator.
# Attributes
# .ans
The prev answer of this calculator.
# .equation
The prev equation of this calculator.
# .skipError
Decide should this calculator use Exception to traceback error.
- Type
- Default
true
- Example
# .useEval
Decide should this calculator use eval (opens new window) to calculate.
- Type
- Default
false
- P.S.
false
: Fastertrue
: Safer
# .showEquation
Decide should this calculator print equation when calculated.
- Type
- Default
false
- Example
# Methods
# await calculate(equation)
calculate the
equation
(same asdef
run())
- Parameters
- equation (str (opens new window)) - the equation you want to calculate.
(You can use these symbol)
- equation (str (opens new window)) - the equation you want to calculate.
- Returns
- answer or error of the equation
- Return type
# calculateEquation()
old codes
# run(equation)
calculate the
equation
- Parameters
- equation (str (opens new window)) - the equation you want to calculate.
(You can use these symbol)
- equation (str (opens new window)) - the equation you want to calculate.
- Return
- .ans - answer of the equation
- Return type
- .ans or str (opens new window)(errors)
# getAns()
old codes
# getList()
old codes
# fix()
old codes
# fixList()
old codes