MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / classify

Function classify

06_pattern_matching/python/pattern_matching.py:14–19  ·  view source on GitHub ↗
(pet)

Source from the content-addressed store, hash-verified

12
13
14def classify(pet):
15 match pet:
16 case Cat(age=age):
17 print("A cat that's {} years old".format(age))
18 case Dog:
19 print("A dog named {}".format(pet.name))
20
21def number(x):
22 match x:

Callers 1

Calls 1

printFunction · 0.50

Tested by

no test coverage detected