Rather than cheating this could be accepted as getting the correct answer in another fashion of which has not been taught to you unless I am mistaken for I have not seen the python course recently but nonetheless well done and could you share the question so I may analyse it further.
I can see that it says not to use the sum function so it seems to be and error on their part
Codacademy marks you by A: checking to see the console log to see if they are no errors, if not then to the next part, B: were it checks if the output is correct, with few courses to mark your code as the amount of variations to compute would exceed their computing power,
Imagine this, You write:
and another person writes like:
You are both correct but there are variations within your code.
Hope this helped.