|
The checker can evaluate your answer to True if it has nan (not a number). Always print your answer to make sure you got it right. In my case, I got this (I know most people won't make the mistake I did, but better to be safe):
Second Test case
|
|
There is a small change to the test routine that will catch NaN input. Inf input would already be handled correctly. The original routine is:
Since (nan < x) is always false, as is (nan > x) and (nan == x), then switching the logic around will catch NaNs.
Or just,
|