DEV Community

Haider Ali
Haider Ali

Posted on • Updated on

New Feature in Python 3.10

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')
Enter fullscreen mode Exit fullscreen mode

It works like a if, elif, and else together

Discussion (3)

Collapse
shapeshapa profile image
shapa

i always love the case match from c#

Collapse
raulsrule profile image
Rahul Kurup

i don't know python, but shouldn't it be corrected like this -
match python: -> match name:

Collapse
haider__ali profile image
Haider Ali Author

Oh sorry I realized it’s a typo thanks