Base Check challenge has description and Python solution issues
Describe the Issue
The JavaScript and Python versions of the Base Check challenge share three description problems:
The description calls individual characters integers:
- The string may contain integers, and uppercase or lowercase characters.
An integer is a complete number, not one character within a string. The comma before
andis also unnecessary because the sentence joins only two items.The base range is malformed and repeats information from the opening sentence:
- The base can be any number 2-36.
The sentence omits the word that connects
numberto the range. It also describes the base less precisely than the opening sentence, which identifies it as an integer from 2 to 36.The introduction to the base examples uses a singular noun:
- Example of valid digits for bases:
The nested list contains five examples, not one, and
for basesdoes not identify them as examples from different bases.
The Python version also has a behavior mismatch:
Its reference solution accepts an empty string:
for char in newN: if char not in availableChars: return False return TrueAn empty string does not represent a number, but the loop performs no iterations and the function returns
True. The JavaScript solution returnsfalsefor the same input, and neither challenge tests this case.
Affected Pages
https://www.freecodecamp.org/learn/dev-playground/daily-coding-challenges-javascript/challenge-2
https://www.freecodecamp.org/learn/dev-playground/daily-coding-challenges-python/challenge-2
Expected behavior
Both descriptions should use the correct terms for individual digits and letters, define the allowed integer base range once in a complete sentence, and introduce the five base examples with plural wording.
An empty string should be treated as an invalid number in both challenges. The Python reference solution and the synchronized JavaScript and Python tests should enforce the same result.
Source: freeCodeCamp/freeCodeCamp