Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python switch statement

def f(x):
    match x:
        case 'a':
            return 1
        case 'b':
            return 2
        case _:
            return 0   # 0 is the default case if x is not found
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #switch #statement
ADD COMMENT
Topic
Name
9+6 =