Variable names in the assignments

This is a general question.

I am on step 64 of “Learn Classes and Objects by Building a Sudoku Solver”. I have noticed in several of the assignments in this module that I will get the correct code input, but I fail because the variable name I have chosen is different than what the system is expecting.

For example, I used :

for x in range(1,10):
    pass

but I did not pass. This wasn’t a big deal on this step because the first hint had the correct variable in it:

for guess in range(1,10):
    pass

Does anyone else run into this with FCC?

Edit: Spelling

Hey @scottofalltrades , this is related to how the code is tested. As long as the variable name is a valid name (only letters, underscores, no number at the beginning and so on) it shouldn’t be a problem, but sometimes tests require a specific variable name. Usually, it is specified in the description. In this case it is specified in the hint but it should be added to the description for clarity.

That makes perfect sense. Gave me a great oppurtunity to do a PR with FCC and fix it.

From what I remember there are challenges where the variable name is not explicitly mentioned, but test will accept various names. Not passing might be caused by something else.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.