In today's video we look at how to refactor an if-elif-elif...-else statement using the "dictionary dispatch pattern" in Python. 💡
As a bonus we also add some ad hoc testing to the mix and refactor further using the operator module. 😎
---
Learn more about Pybites / what we do: https://pybit.es
Get our weekly developer / mindset emails: https://pybit.es/friends/
Join our Slack community: https://pybit.es/community/
And last but not least, we appreciate any feedback to make our YouTube content better 💡
https://form.jotform.com/230941798741062 🙏