Assertions, Pre- and Post-Conditions and Loop Invariants
Assertions, Pre-conditions, and Post-conditions
Before we can define and use loop invariants, we must first understand the concept of assertions, pre-conditions and post-conditions in a programming language.
Pre- and Post-Conditions
The following video uses Python to explain the role of pre- and post-conditions as an important aid in testing a program.