C3_W3 Grader Error

I have completed all the UNQ boxes. It is coming as correct in the grader as well. Even after all this, the grader is giving me only 75% and not 100%. Not sure what the problem is. Can any moderator help me here?

Note: In UNQ_C2, I have len(labels) in my for loop for iterating over different label instances. Dont know why it is showing that I dont have that code. It is very strange.

[code removed from moderator]

Try removing that 0 inside the range()!

1 Like

Thanks Gent, it worked as well!

But, just wondering, my earlier code worked as well for all the intuitions in the notebook, and also with the grader. Why does the grader needs this code, only in this way. Can you please let me know the significance of having it this way?

Thanks in advance!

hi @ArunSukumar

The range() function returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and stops before a specified number or based on the recall function further in a loop, but when you include that 0 with len(labels), it is creating a value error as it includes the 0 in that range other than the index of labels.

Regards
DP

1 Like