Spaces:
Sleeping
Sleeping
Updated match expression
Browse files
app.py
CHANGED
@@ -17,13 +17,13 @@ def my_calculator(arg1:int, arg2:int, op:str)-> int: #it's import to specify the
|
|
17 |
op: the operation
|
18 |
"""
|
19 |
match op:
|
20 |
-
case "*":
|
21 |
return arg1 * arg2
|
22 |
-
case "/":
|
23 |
return arg1 / arg2
|
24 |
-
case "+":
|
25 |
return arg1 + arg2
|
26 |
-
case "-":
|
27 |
return arg1 - arg2
|
28 |
case _:
|
29 |
return 0
|
|
|
17 |
op: the operation
|
18 |
"""
|
19 |
match op:
|
20 |
+
case "*" | "multiply":
|
21 |
return arg1 * arg2
|
22 |
+
case "/" | "divide":
|
23 |
return arg1 / arg2
|
24 |
+
case "+" | "add":
|
25 |
return arg1 + arg2
|
26 |
+
case "-" | "subtract":
|
27 |
return arg1 - arg2
|
28 |
case _:
|
29 |
return 0
|