It is not PEP8 compliant to use the == equality operator to compare values to booleans. We should use keyword 'is' instead.
Didn't exactly feel like an 8 kyu exercise. The implementation was simply enough, but the logic I feel like is a bit of a head scratcher.
This comment is hidden because it contains spoiler information about the solution
What was the reason for having the last line with no line break?
The expected result shows that the basic tests require the trailing '\n' to pass them. My code does not provide that. When I run my solution, it literally prints the exact result requested in the kata. Try it.
I learned something here so thank you for your comment.
What happened was, I was using * arr as when I tried to run the program in python IDE it was throwing an error that I gave the function 8 positional arguments.
This was because I did not define the array and then use it's name (arr) to pass it to the function. Once I removed * and defined the array, then passed it, it worked.
The error messages in the tests confused me because the first sample test error message was that None should equal 6. I thought that meant that it was skipping the trigger return statement in my loop that would terminate the function, returning what result was first initialised as. I thought for some reason the return statement in the loop was not working in codewars lol
So yea, now I understand and thank you once more.
oh damn, so it is spelling mistakes. let me try that and I will update here lol thank you