Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Hello! Try writing solutions for smaller arrays on paper (Note that there are many solutions). Some of them will help you find the pattern
count
is very inefficient: each time you use it, it needs to parse the whole object it is applied to. There are much better alternatives in Python (make a smart research online and you should find it); there may be other points to enhance or change in your code, though.See there to format your code: https://docs.codewars.com/references/markdown/#code-block
Please print the input value with the test result, otherwise you'll never know what's wrong.
If a problem with the tests existed, somebody would have noticed before.
Your code is failing this sample test, you can see the expected answer is ok, your code is wrong:
There is no
n
in the input, your code is returning '@[`n'All I can say is the ASCII value for 'z' is 122
The error message is like this: your wrong answer should equal the expected value. To see the input values, print them.
my python returns true, if i do:
1/5 == 0.2
Because that's how floating point arithmetic work, not only in Python.
Helper question: how much is 1/5 in Python? Hint: its not 0.2.
Which language/test are you talking about?