>>> assert true Traceback (most recent call last): File "", line 1, in NameError: name 'true' is not defined >>> assert True >>> assert False Traceback (most recent call last): File "", line 1, in AssertionError >>> assert len(tup) = 10 File "", line 1 assert len(tup) = 10 ^ SyntaxError: invalid syntax >>> assert len(tup) == 9 >>> assert len(tup) == 5 Traceback (most recent call last): File "", line 1, in AssertionError >>> def check(a, b): ... assert a == b ... print 'a equals b' ... >>> check(5,5) a equals b >>> check(4,5) Traceback (most recent call last): File "", line 1, in File "", line 2, in check AssertionError >>> def more(): ... check(5,5) ... check(5,6) ... print 'after assert fails' ... >>> more() a equals b Traceback (most recent call last): File "", line 1, in File "", line 3, in more File "", line 2, in check AssertionError >>>