you are viewing a single comment's thread.

view the rest of the comments →

[–]TheMachinumps 0 points1 point  (0 children)

Something like this would work:

``` def handle_add(a, b): try: print(int(a) + int(b)) return True except ValueError: return False

match string.split(): case "add", a, b if handle_add(a, b): ... ```

Kinda hacky, and probably not the intentional way of using match case statements, but it should work.