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 a kata issue, you're supposed to return a new
Vector
not alist
.You have to return a Vector object with the new values from add or whatever.
This statement -->
Raise a ValueError if there isn't enough money to withdraw
should be clear enough, not a kata issue!Same problem!
I have same problem and i will very happy if someone help with this problem :)
don't mutate the instances.
Python: Issues with (Possibly) test cases? This is odd. My code runs fine on my IDE. My equals function returns true or false and my athrmeitc functions reference my equals function and raise exception if the two vectors are different lengths. When tested "a.add(b).equals()' gives AttributeError: 'list' object has no attribute 'equals' becuase the response from my add function is another list, as the sum of the two vectors. are we meant to instantiate another Vector class as the response and check if it is equal to one or both input vector objects?
Can someone explain how to make the equals function pass through the test cases? or restate what is expected here?
(author here :)
You are right that this is not "best practice", because there is too much going on. This would be more readable and understandable when broken into a full loop and clear if/else statements.
On the other hand, list comprehensions are useful. I suggest to try to turn your loops into comprehensions, just for the practice. You don't need to always use them, but you will find them handy in some cases.
Cheers
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution