match / case
Python Switch / case
structural pattern matching
Flowchart (ISO 5807)
Source code
def name(code):
match code:
case 1:
return "один"
case 2:
return "два"
case _:
return "інше"