AI engineering glossary · Python core
What is valueError?
ValueError: A built-in exception raised when a function receives an argument of the right type but an unsuitable value. It is common when converting text to numbers. It is usually caught with try/except when handling user input, so a program can ask again instead of crashing.
ValueError: an example
int('12.5') and math.sqrt(-1) both raise ValueError.
Related terms
More Python core terms
Where you learn it
ValueError is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.