assert check python code example
Example 1: assert syntax python
assert <condition>,<error message>
#The assert condition must always be True, else it will stop execution and return the error message in the second argument
assert 1==2 , "Not True" #returns 'Not True' as Assertion Error.
Example 2: how to use assert in python
assert type(num) is int,"num must be an integer"