Skip to content
Snippets Groups Projects
Commit d42f0773 authored by Alexandre Faure's avatar Alexandre Faure
Browse files

Update operators.py

parent 0d923dcc
Branches tp2
No related tags found
No related merge requests found
Pipeline #46401 passed
"""
Operator module contains the Operator class and a list of standard operators.
"""
class Operator:
"""
Operator class is a binary operator with a symbol, a precedence and an evaluation function.
......@@ -21,6 +23,6 @@ class Operator:
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),
'/': Operator('/', 2, lambda a, b: a / b),
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment