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.
The tests are fine, it's your job to make that work:
I just tried the code from your link, it fails. Try running
print(series_sum(58))
, it prints 2.4, not 2.40.I forked your code to add this line:
print(series_sum(58))
it prints 2.4, not 2.40Floating point numbers in python will eliminate extreneous 0's by default. You can try this:
The above will output
2.4
. In your code, for this test specifically, you are getting a result for sum of2.3965...
, then you are rounding it to 2 decimal places to produce what would be2.40
, but because it's a floating point number and that last 0 doesn't matter, it actually produces2.4
. You then convert it to a string to make'2.4'
. I don't know why this works differently in jupyter notebook for you. If I had to guess, you probably have the test set up incorrectly. Either that, or there's a big problem with the way jupyter notebook handles float values in python.Edit: I just tried your code on jupyter notebook's online demo thing, and it fails there as well.
Tried your code in Repl.it and it also fails there.
This is a question, not an issue. An issue is a bug in the kata itself.
From the description:
Your return value always needs to have 2 decimal places, even if 1 or 2 of those decimal places are '0'. The error you mentioned indicates that you returned an answer of '2.4' instead of '2.40', you're missing a '0' on the end.