Skip to content
Snippets Groups Projects
Commit 4be4bb45 authored by Arthur Jacquin's avatar Arthur Jacquin
Browse files

Add modulo

parent 4273d1a4
No related branches found
No related tags found
No related merge requests found
Pipeline #46430 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,7 @@ 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),
'%': 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