you catch
Note that you need to convert
ValueError
in the except part, but what you get is TypeError
, so it is not handled and is raised.Note that you need to convert
number
to int
or float
before apply modulo %. Now it is str
and % is treated as old-style string formatting.
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