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.
Duplicate suggestion above
If it requires a hint, so do all other katas.
Indeed, especially
is WAY more accurate. I'm filing an issue because "Furthermore the percent of loss" clearly implies that it only goes for the depreciation of the OLD car, not the new (that's a WIN, not a LOSS)
Not an issue.
codewars uses its own testing framework that's only vaguely related to how testing works in different languages
In the unittest given, shouldn't
assert_equals(a, b)
beassertEqual(a, b)
with Python??See [https://docs.python.org/3.6/library/unittest.html#assert-methods]
It helped to skim over the discourse prior to attempting this Kata. In particular, the improved description provided by designerzim was comprehensive and cleared potential misunderstandings.
This comment is hidden because it contains spoiler information about the solution
You're meant to return the value as a Bool and not a string. Remove the quotation marks and capitalise them.
Boolean values have a signicant meaning and cannot be represented in strings in order to make them work. This is similar to numbers in programming: "5" and 5 are completely different things and are examples of polymorphism.
This comment is hidden because it contains spoiler information about the solution
Hard to determine without seeing your code - post it as a reply to this comment and I can have a look for you.
√-1 = i
i is a complex number. You cannot square root a negative number - otherwise it ends up being a complex number (imaginary). You must check if n >= 0
My solution in Python 2 was not passing the tests for non-square numbers when using
return 'false'
, but it passed the tests withreturn 'true'
with square numbers and all tests with random numbers.What was wrong?
This kata raised my awareness of Python indentation to a new level.
I ran your solution in both Python 2 and Python 3 here and no errors like the one you mentioned.
Your solution is working just fine. Check your indentations and try again!
Loading more items...