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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Anyone came up with a working solution for this? I'm also puzzled as to why the formula works for smaller numbers, but doesn't work for the big ones.
Even when specifying int. I also found that the formula breaks at exactly 16th digit. I.E. the first 16 digits are always correct.
EDIT: I finally have an answer. The thing is, even when I specify int(), python still converts to float when dividing. Naturally, changing all divisions to floor divisions (//) solved the problem.
Thank you for that. Finally found the issue. I forgot to reset my variables after calling the function once.
This comment is hidden because it contains spoiler information about the solution
Coming from a Python noob, for those (like me, one hour ago) who think that "there's something wrong with this kata and there's no way my script is wrong...right?" I say this:
So far, this is the most effective kata at teaching some very fundamental concepts that I definitely missed.
I strongly recommend reading this: https://nedbatchelder.com/text/names1.html
I promise, you'll come back with a solution.