Honestly, tho, not a 8kyu more of a 7. However rank cannot be changed right?
Thank you @thecodeite! :)
Thanks, I've fixed the test code to remove the warning aboout 'i' being unused that was causing confusion.
The error below it is a problem with your code though.
This comment is hidden because it contains spoiler information about the solution
thank you for the clarification! So the issue is not actually residing in different kinds of 'nulls' (or Nones, in Py) that None and pass would generate - as I thought was happening - but in the way I returned None all together.
Much appreciated, Chrono, thank you!
i guess I got thrown off a little by the instructions stating that 'If the whole array is consecutive then return null.' so I would appreciate some clarity on the difference between None and Pass.
In my code, within my if statement, I returned None if the numbers were consecutive, but this would fail the test.
When I changed return None to a pass, the test would pass.
I am trying to understand the difference between None and a pass since pass seems to be a null operation here: https://docs.python.org/2.0/ref/pass.html
Thnks in advance!
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.
It's a problem with your code, why are you using *arr?
Well, the default returned value when you don't explicitly return in Python is indeed None so the tests are ok.
Newbie here. Sorry if it's not the right place to put this.
I wrote a pair of statements to break the ice and tested.
I passed 2 tests that shouldn't (the ones expecting None)
first = arr
I suppose it's because I made the program print instead of return, and even when I print something wrong, I don't return anything (and this is = None?)
Just to let the author know.
Thanks for this kata!
E.g., if we have an array [1,2,3,4,6,7,8,15,16] then 6 and 16 are non-consecutive.
16 should be 15
Resolving the question then.
Thank you both! Both issues are now solved