ml5050 commited on
Commit
bc1123f
·
verified ·
1 Parent(s): 2fa1b15

Update app.py

Browse files

extract computation

Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -18,16 +18,20 @@ def my_custom_tool(arg1:int, arg2:int, arg3:str)-> str: #it's import to specify
18
  """
19
  match arg3:
20
  case "*":
21
- return f"The result is: '{arg1 * arg2}'"
 
22
  case "/":
23
  if(arg2!=0):
24
- return f"The result is: '{arg1 / arg2}'"
 
25
  else:
26
  return f"Error: Division by zero not possible"
27
  case "+":
28
- return f"The result is: '{arg1 + arg2}'"
 
29
  case "-":
30
- return f"The result is: '{arg1 - arg2}'"
 
31
  case _:
32
  return f"Error: '{arg3}' is an unsupported operation, Supported operations are +,-,*,/"
33
 
 
18
  """
19
  match arg3:
20
  case "*":
21
+ result = arg1 * arg2
22
+ return f"The result is: '{result}'"
23
  case "/":
24
  if(arg2!=0):
25
+ result = arg1 / arg2
26
+ return f"The result is: '{result}'"
27
  else:
28
  return f"Error: Division by zero not possible"
29
  case "+":
30
+ result = arg1 + arg2
31
+ return f"The result is: '{result}'"
32
  case "-":
33
+ result = arg1 - arg2
34
+ return f"The result is: '{result}'"
35
  case _:
36
  return f"Error: '{arg3}' is an unsupported operation, Supported operations are +,-,*,/"
37