In which Python version was the match statement for structural pattern matching introduced?
Correct answer B. Python 3.10
Explanation
Structural pattern matching, using the match and case soft keywords, arrived in Python 3.10 through PEPs 634, 635 and 636. It compares a subject against patterns that can destructure sequences, mappings and objects, which makes it far more powerful than a simple switch statement.
Answer checked How we write and check questions
Discussion