(Sep-24-2023, 01:14 AM)Skaperen Wrote: for which this function needs to output a custom error message to explain what is wrong. so this function needs to do its own test of the value.No, it does not need to do test of the value, use try/except instead to gracefully handle the error.
https://docs.python.org/3/glossary.html#term-EAFP
https://realpython.com/python-lbyl-vs-eafp/
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs