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

Function number

06_pattern_matching/python/pattern_matching.py:21–26  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

19 print("A dog named {}".format(pet.name))
20
21def number(x):
22 match x:
23 case 1: print("one"),
24 case 2 | 3: print("two or three"),
25 case x if x >=4: print("four or bigger"), # range matching not yet possible
26 case _: print("anything"),
27
28
29

Callers 1

Calls 1

printFunction · 0.50

Tested by

no test coverage detected