Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

match case in Python

>>> command = 'Hello, World!'
>>> match command:
...     case 'Hello, World!':
...         print('Hello to you too!')
...     case 'Goodbye, World!':
...         print('See you later')
...     case other:
...         print('No match found')
 
Hello to you too!
Source by learnpython.com #
 
PREVIOUS NEXT
Tagged: #match #case #Python
ADD COMMENT
Topic
Name
2+2 =