I just had the same problem.
You are right but freeCodeCamp should change their test so that THERE’S MORE THAN ONE RIGHT WAY and if you mean a sepcific algorithm for any logical test you should explicitly mention it, otherwise allow us to use other methods so that we don’t waste learning time!!
Of course I don’t mean to be negative and appreciate every second I can use this website, but still it’s important
@shlomov1 Generally the instructions are pretty specific and there’s not that many ways to interpret them. How many ways are there to solve the instructions for this step?
In this case, these two patterns are equivalent:
if list:
if len(list) != 0:
You can see one way is a bit better. If you spend some time and learn both of these ways, then you will know them, so it’s not really wasted.
This might be a good case for opening an issue to discuss a change to the instructions to make it more clear.
Aha, it looks like something is already open:
" 34: Test needs to be expanded to allow multiple correct answers (e.g. while len(unvisited) != 0, while unvisited != [], while len(unvisited) > 0)" https://github.com/freeCodeCamp/freeCodeCamp/issues/52582