The error tracebacks are rarely wrong.
Just in case you're not sure how they work, the last displayed line is the culprit most of the time.
All the lines shown before that are the execution order before the error occurred, so you can follow the logic backwards.
Learn to rely on this error display, it's your friend.
By the way, on line 54:
Just in case you're not sure how they work, the last displayed line is the culprit most of the time.
All the lines shown before that are the execution order before the error occurred, so you can follow the logic backwards.
Learn to rely on this error display, it's your friend.
By the way, on line 54:
except KeyErrorIs missing a ':' on the end.