Python 3.10 added support for the switch
keyword.
Implement switch statements in Python
The basic syntax for a switch statement is:
|
|
A direct example:
|
|
Output:
|
|
In Python, break
statements are not required.
Python 3.10 added support for the switch
keyword.
The basic syntax for a switch statement is:
|
|
A direct example:
|
|
Output:
|
|
In Python, break
statements are not required.