Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

assert in python

# AssertionError with error_message.
x = 1
y = 0
assert y != 0, "Invalid Operation" # denominator can't be 0
print(x / y)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #assert #python
ADD COMMENT
Topic
Name
6+1 =