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.
OP solved it, closing
your nested conditions are difficult to track and will hurt any reasoning you do about the rest of the code. you can write those conditions as early exits instead, without nesting the rest - thereby keeping it sequential:
you've done some printing which is good but maybe you're not printing the relevant pieces of information. if you write out step by step what the program is doing then you can tell from the output where it's going wrong.
looks like you've since found the bug - you would see through printing that you had very small differences between the values that you compared, this is because floats are typically approximations, and it's incorrect to test wether two approximations are exactly equal
another thing is to avoid the word "wrong" and instead describe the problem in terms of what happened differently from the desired outcome.
This comment is hidden because it contains spoiler information about the solution
the error is still there
This comment is hidden because it contains spoiler information about the solution