ValueError

The Python exception raised when a function gets an argument of the right type but an unacceptable value, such as int("hello").

In more detail

It is what conversions raise on bad input, so catching ValueError around int(input()) is the standard way to ask again. Raise it yourself when a function receives an argument it cannot accept.

Related terms

Taught in

References

Certification courses