Seeming discrepancy between instructions and tests in Largest Series Product

Not sure if I got this right, but check Largest Series Product in Python. The instructions tell that if “span of number is zero or negative”, we must raise ValueError("span must be greater than zero"). However, the tests check - and community solutions implement - only if the span is negative, and if so, we must raise ValueError("span must not be negative").

There seems to be a discrepancy: did I get something wrong?

1 Like

Checks out.

-# span of number is zero or negative
+# span of number is negative
-raise ValueError("span must be greater than zero")
+raise ValueError("span must not be negative")

The instructions explicitly allow 0-width spans:

For a series of zero digits, the largest product is 1 because 1 is the multiplicative identity.

I guess the discrepancy is a result of the shared instructions and possibly tests were updated after the last time the Python-specific appendage was revised.

Thanks for confirming, Matthijs! Yes, that’s the change I propose too. I’ve checked - and this is specific to Python as I assumed, so we just have to submit a PR to this document. This will not result in any code rewrites by the community, as it’s only a wording change.

@MatthijsBlom @safwansamsudeen - would one of you like to submit a PR for that? Happy to re-ope and review.


A wrinkle: See the discussion on this problem-specs issue (apologies I didn’t see it sooner!!). So we might need to update your PR to sync the new instructions, update the JinJa2 template, regenerate the test files, and remove the error messages from the addendum…

I think Katrina will be submitting a sync PR, but then we’ll need to do the omissions/adjustments.

I haven’t looked too closely, but right now I do not see a problem. It seems to me the exception messages remain applicable.

The tests will still need to be regenerated and the template fixed. I’ll take a look next week when the PR to the tracks goes through.