Python 3.10 will be released on 4 October 2021, there is a new feature match
do you know JavaScript, you know how switch
works the no need to worry it works same as that but if you don't here are some examples.
name = 'python'
match name:
case 'java':
print('Java')
case 'python':
print('Python')
It works like a if
, elif
, and else
together
Top comments (3)
i always love the case match from c#
i don't know python, but shouldn't it be corrected like this -
match python:
->match name:
Oh sorry I realized it’s a typo thanks