You’ve learned the ins and outs of using any() in Python and the differences between any() and or. You’ve also explored short-circuiting and using list comprehensions with any(). With a deeper understanding of these two tools, you’re well prepared to decide between them in your own code.
In this course, you learned how to:
- Use any() and not any()
- Elimate long or chains
- Use any() with list comprehensions
- Evalute values that aren’t explicitly True or False
- Distinguish between any() and or
- Use short-circuiting
For more information on concepts covered in this course, you can check out:
deepakpatrick on Feb. 27, 2022
The last print output seems counter intuitive