FAQs on the exercise Customizing User-defined Exceptions
There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
You can also find further discussion and get answers to your questions over in Language Help.
Agree with a comment or answer? Like () to up-vote the contribution!
The f-string is relatively new, and much of the course material was written before it was introduced. Guess the only thing we can do is try, and if it doesn’t work (as in pass) then revert to the legacy methods.
TBH, I have no idea how old or new half the courses are. We only get the flack on this side, and have no part in creating courses. With so many writers coming and going, and very little quality control, it’s no wonder the SCTs for each course differ by so much. Nothing we can do but pass on the message.
If the intention is to give the human user something that is meaningful to them, such a date or string value then stick with __str__().
Say you have an attribute that is assigned a datetime object. If __repr__() is used, it will be the object representation that the human reader will see, which won’t make a lot of sense. However, using __str__() the user will see the actual date string…