Image by Hannah Ensor on Shutterstock

Digging Deeper Into Python and Boolean Operators

Circuit Breakers and You

A Python Brain Teaser

3 min readSep 2, 2021

--

📚 Connect with us. Want to hear what’s new at The Pragmatic Bookshelf? Sign up for our newsletter. You’ll be the first to know about author speaking engagements, books in beta, new books in print, and promo codes that give you discounts of up to 40%.

Let’s say you are working on a new Python project. A member of the data science team has written the following normalize function:

You’re assigned the task of testing it. Here’s the first test you write, checking for errors:

When you run the test, it fails!

--

--