Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python if something exception

# Simple example on how to throw an exception if value has a certain value!
x = 10
if x > 5:
    raise Exception('x should not exceed 5. The value of x was: {}'.format(x))
 
PREVIOUS NEXT
Tagged: #python #exception
ADD COMMENT
Topic
Name
8+8 =