Python Python Basics All Together Now Handle Exceptions

Tanisha Wakefield
PRO
Tanisha Wakefield
Pro Student 7,225 Points

masterticket.py ValueError as err

After adding the 'as err' to fix the user issue of inputting too many tickets, when I tested the issue for the blue input again, it comes up with "invalid literal for int() with base 10: 'blue'" instead of the original message.

Josh Keenan
Josh Keenan
17,359 Points

Can you post your code?

2 Answers

Josh Stephens
Josh Stephens
11,474 Points

If I am reading that error output correctly it appears that you are trying to use a string literal somewhere in which your program is expecting an int. However I concur with Josh Keenan that posting your code might be really useful to help with the debugging of it.

Gia Hoang Nguyen
Gia Hoang Nguyen
4,114 Points

i ran into the same problem and still dont know how to fix it

Josh Keenan
Josh Keenan
17,359 Points

Can you post the code?