Match-Case Statement (Python 3.10+) in Python

🟡 Intermediate

📖 Definition

Python 3.10+ introduced Match-Case (Structural Pattern Matching) using match and case keywords.

âš¡ Code Example

status = 200
match status:
    case 200: print("OK")
    case 404: print("Not Found")
    case _: print("Error")

🧭 Navigation

← 03. Elif-Else Ladder in Python | Module Index | 05. Nested Conditionals in Python →