andersoncliffb commited on
Commit
c8cc7db
·
verified ·
1 Parent(s): aebda53

Updated match expression

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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