Code 85
Published in

Code 85

How to Use Switch Statements in Python

Get rid of cumbersome elif trees with pattern matching

Photo by elen aivali on Unsplash

Whenever I’m asked “why Python?” the answer undoubtedly revolves around its ease-of-use and human-logical style of syntax. Especially coming from other languages such as PHP, Java, or JavaScript, Python simply makes more sense.

Starting in version 3.10, one of my last…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store