PYTHON PROGRAMMING
Python Assertions, or Checking If a Cat Is a Dog
Learn the rules of using assertions in Python — and those of not using them
Published in
13 min readMar 2, 2023
An assertion is a statement you can use to test an assumption about your program. This short definition is, on the one hand, clear. On the other hand, it’s far from explaining when you should use…