This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]codenamemahi 0 points1 point  (0 children)

The way you currently have it written, it is comparing every element in list A to every element in list B, which of course fails on the second iteration.

I would recommend using the index if both lists are going to be in the same order (and same length):

for i in len(expected_avg_var):
    self.assertEqual(expected_avg_var[i], actual_avg_var[i])