Skip to content
Snippets Groups Projects
Commit bfc8ede7 authored by Clément Charlier's avatar Clément Charlier
Browse files

mod

parent 14921d34
No related branches found
No related tags found
No related merge requests found
Pipeline #46352 passed
"""
Expression module defines the structure of an expression.
"""
from calculator.operators import Operator
from typing import Union
from calculator.operators import Operator
Term: type = int
Token: type = Union[Operator, Term]
......
......@@ -17,4 +17,7 @@ class Operator:
return self.evaluate_function(left, right)
STANDARD_OPERATORS = { '+': Operator('+', 1, lambda a, b: a + b),'-': Operator('-', 1, lambda a, b: a - b),'*': Operator('×', 2, lambda a, b: a * b),'/': Operator('/', 2, lambda a, b: a / b)}
STANDARD_OPERATORS = { '+': Operator('+', 1, lambda a, b: a + b),
'-': Operator('-', 1, lambda a, b: a - b),
'*': Operator('×', 2, lambda a, b: a * b),
'/': Operator('/', 2, lambda a, b: a / b)}
from calculator.calculator import Calculator
"""Import des modules"""
from fastapi import FastAPI
from fastapi.requests import Request
from fastapi.templating import Jinja2Templates
from calculator.calculator import Calculator
app = FastAPI()
templates = Jinja2Templates(directory="calculator/templates")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment