Python 的 ValueError
用法:
Raised when a built-in operation or function receives an argument that has the right type but an inappropriate value, and the situation is not described by a more precise exception such as
IndexError
.
意即类型是对的,但是与期望的值不同。比如规定只能输入某些字符串,其他的都不合理。