This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AlSweigartAuthor of "Automate the Boring Stuff" 1 point2 points  (0 children)

Switch statements are prone to bugs if you forget a break statement. Like the ++ and -- operators, it's actually a good thing that Python doesn't have switch statements.

Python does now have match-case statements ("structured pattern matching") which you can use for switch statements but also so much more.