assert python raise error code example Example: how to use assert in python assert type(num) is int,"num must be an integer"