Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

assert in python

a = 5
assert a == 5 # True
assert a == 42 # False, the program fails

#OUTPUT
Traceback (most recent call last):
  File "none.py", line 155, in <module>
    assert a == 42
AssertionError
Source by rosettacode.org #
 
PREVIOUS NEXT
Tagged: #assert #python
ADD COMMENT
Topic
Name
3+9 =