Assert is a run-time check of any condition. If the condition is not true, an AssertionError exception happens and the program stops.
This is not used for "expected" error conditions, such as a network connection that did not open. The objective of the assert is to aid in debugging by verifying the internal sanity of the program.
The Using Assertions Effectively page suggests using to check the parameter types of a function or method. I would not use it for this. The most correct use is to catch those seemingly impossible conditions of error (but they end up happening anyway).
If the algorithm itself causes an error in case of inconsistency, I do not see why to use assert. In the following code, it is critical that foo () return a number between 0 and 5, but the code itself ensures that an out-of-range number throws an exception:
n = foo()
s = ["a", "b", "c", "d", "e", "f"][n]
On the other hand, if "n" is critical but it is used for a math operation, which would not fail if n is out of range, then the assert is interesting:
n = foo()
assert n >= 0 and n <= 5
s = chr(ord('a') + n)