python how to raise Value error code example
Example 1: python raise exception
# this raises a "NameError"
>>> raise NameError('HiThere')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: HiThere
Example 2: raise valueerror
raise ValueError('A very specific bad thing happened.')