in Python il costrutto switch-case é disponibile solo dalla veriosne 3.10 in poi

in caso si usa if-else

sintassi
match valore/variabile:

case valore:
...

case other: resto dai casi
...



esempio
testo = 'Hello, World!'

match testo:

case 'Hello, World!':
print('Hello to you too!')

case 'Goodbye, World!':
print('See you later')

case other:
print('No match found')