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.
Not an issue, and lacking precisions.
The test is fine.
It always works like that. Just add a print command as the first line of the function, which prints all incoming function parameters.
Your code uses the floating point number division operator / instead of // for integer division since python version 3.
In python versions 2.x / could mean integer division, but this has been changed incompatibly since version 3.
You must calculate with integers only, not floats. Then it works.
The problem is that floating point numbers have only limited precision, they can't store verly large integers.
In python, integers can be as large as you want, but always divide using // to get an integer result.
You could google "reducing fractions to same denominator".
the packets with at most 3 digits in this string
0 9026315 -827&()
is
0 902 631 5 827
Who agree with me ?Cal the cubic of each digit and sum up all
0 737 244 125 863
Then check sum only '0 Lucky'
i beleive something wrong with test case
please all help, it is nice kata but tooks me a while to figure it out :) .
See the example in the kata description:
If there is only a single cubic number, the sum is the number itself.
The only hidden cubic number is
0
, the sum is also0
.The second 0 is
sumOfCubicNumbers
We search non-negative integer numbers, with at most 3 digits: here 0 must be considered a separated number (and it's a lucky one, obviously). Numbers are formed with consecutive digits (and then split in chunks of 3 if they are longer), so here you would have the following numbers: 0, 902, 631, 5 and 827.
Check two posts below yours. It says at most 3 digits, 0 is a single digit number and it is a hidden cubic number.
Just add
print(lst)
as the fist line of your function. It prints input of all tests and not the input of only failed tests, but you should focus on lines printed immediately before the red message, just like the article explains. Copy the test case into your IDE and debug your solution locally.If you have any problems with debugging your solution just paste your code here and someone could probably guide you further.
That ^
You can read this paragraph to find out how to check inputs: https://docs.codewars.com/training/troubleshooting#print-input
You can also raise a suggestion (or issue) about insufficient feedback from failed tests, so hopefully author improves tests so they give better information.
Print the input.
Loading more items...