Python ValueError is raised when a function receives an argument of the correct type, but an inappropriate value. Also, the situation should not be described by a more precise exception such as IndexError. ValueError is raised in a lot of mathematical operations in the math module.