I'm trying to run this:
try:
number = int(number)
except ValueError:
raise InvalidValueError("%s is not a valid base10 number." % number)
So, when I set number = '51651a'
I'm getting this:
Traceback (most recent call last):
File "test.py", line 16, in decbin
number = int(number)
ValueError: invalid literal for int() with base 10: '51651a'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test.py", line 51, in <module>
print(decbin('51651a', True))
File "test.py", line 18, in decbin
raise InvalidValueError("%s is not a valid base10 number." % number)
__main__.InvalidValueError: 51651a is not a valid base10 number.
My question is that is there any way I don't see the line saying, "During handling of the above exception, another exception occurred:" and all that's above it.