Python Python Basics All Together Now Cleaner Code Through Refactoring

vikas Rai
vikas Rai
9,703 Points

If user enters "too many" as an input for number of tickets then i am getting "invalid literal for int() with base 10: "

When we are catching auto raised ValueError(user is putting string value for number of tickets) and manually raised ValueError(number of tickets>remaining tickets) under same same ValueError exception then there is an issue.

1 Answer

Steven Parker
Steven Parker
173,578 Points

Don't worry, that is the correct behavior.

What you are seeing is the default message generated by the system when an exception is thrown from attempting to convert a string that does not consist of digits (like "too many") into a number.