I have no idea what went wrong here, Exercise 3 and 4

{moderator edit - solution code removed}

Notice that you have hard-coded the values 55 and 54 in your logic. Maybe the grader uses a test case with a different number of samples. Just in general it’s a bad idea to hard-code assumptions about dimensions unless you literally have no other choice.

Try recoding it using the “shape” attribute of the input and see if that helps.

1 Like